-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Christian Kotzbauer <[email protected]>
- Loading branch information
1 parent
88f36a7
commit d076603
Showing
3 changed files
with
100 additions
and
119 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,13 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup AWS CLI | ||
uses: unfor19/install-aws-cli-action@v1 | ||
|
||
- uses: azure/[email protected] | ||
with: | ||
version: 'v1.24.0' | ||
|
||
- name: Install GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
|
@@ -35,12 +42,102 @@ jobs: | |
- name: Build binary | ||
run: make build | ||
|
||
# - name: Prepare ACR secrets | ||
# shell: bash | ||
# run: | | ||
# mkdir auth | ||
# | ||
# kubectl create secret docker-registry acr-secret \ | ||
# --docker-username="${{ secrets.TEST_ACR_USERNAME }}" \ | ||
# --docker-password="${{ secrets.TEST_ACR_PASSWORD }}" \ | ||
# --docker-server=sbomgitoperator.azurecr.io \ | ||
# --docker-email="${{ secrets.TEST_EMAIL }}" \ | ||
# -o json --dry-run=client | jq -r '.data.".dockerconfigjson"' > auth/acr.yaml | ||
|
||
- name: Prepare ECR secrets | ||
shell: bash | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.TEST_AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.TEST_AWS_SECRET_ACCESS_KEY }} | ||
AWS_REGION: eu-central-1 | ||
run: | | ||
mkdir auth | ||
kubectl create secret docker-registry ecr-secret \ | ||
--docker-username=AWS \ | ||
--docker-password="$(aws ecr get-login-password)" \ | ||
--docker-server=055403865123.dkr.ecr.eu-central-1.amazonaws.com \ | ||
--docker-email="${{ secrets.TEST_EMAIL }}" \ | ||
-o json --dry-run=client | jq -r '.data.".dockerconfigjson"' > auth/ecr.yaml | ||
- name: Prepare GAR secrets | ||
shell: bash | ||
env: | ||
TEST_GAR_PASSWORD: ${{ secrets.TEST_GAR_PASSWORD }} | ||
run: | | ||
kubectl create secret docker-registry gar-secret \ | ||
--docker-username=_json_key \ | ||
--docker-password="$TEST_GAR_PASSWORD" \ | ||
--docker-server=europe-west3-docker.pkg.dev \ | ||
--docker-email="${{ secrets.TEST_EMAIL }}" \ | ||
-o json --dry-run=client | jq -r '.data.".dockerconfigjson"' > auth/gar.yaml | ||
- name: Prepare GCR secrets | ||
shell: bash | ||
env: | ||
TEST_GCR_PASSWORD: ${{ secrets.TEST_GCR_PASSWORD }} | ||
run: | | ||
kubectl create secret docker-registry gcr-secret \ | ||
--docker-username=_json_key \ | ||
--docker-password="$TEST_GCR_PASSWORD" \ | ||
--docker-server=gcr.io \ | ||
--docker-email="${{ secrets.TEST_EMAIL }}" \ | ||
-o json --dry-run=client | jq -r '.data.".dockerconfigjson"' > auth/gcr.yaml | ||
- name: Prepare GHCR secrets | ||
shell: bash | ||
run: | | ||
kubectl create secret docker-registry ghcr-secret \ | ||
--docker-username="${{ secrets.TEST_GHCR_USERNAME }}" \ | ||
--docker-password="${{ secrets.TEST_GHCR_PASSWORD }}" \ | ||
--docker-server=ghcr.io \ | ||
--docker-email="${{ secrets.TEST_EMAIL }}" \ | ||
-o json --dry-run=client | jq -r '.data.".dockerconfigjson"' > auth/ghcr.yaml | ||
- name: Prepare Hub secrets | ||
shell: bash | ||
run: | | ||
kubectl create secret docker-registry hub-secret \ | ||
--docker-username="${{ secrets.TEST_HUB_USERNAME }}" \ | ||
--docker-password="${{ secrets.TEST_HUB_PASSWORD }}" \ | ||
--docker-server=https://index.docker.io/v1/ \ | ||
--docker-email="${{ secrets.TEST_EMAIL }}" \ | ||
-o json --dry-run=client | jq -r '.data.".dockerconfigjson"' > auth/hub.yaml | ||
- name: Prepare legacy GHCR secrets | ||
shell: bash | ||
env: | ||
TEST_GCR_PASSWORD: ${{ secrets.TEST_GCR_PASSWORD }} | ||
run: | | ||
cat << EOF > .dockercfg | ||
{ | ||
"ghcr.io": { "username": "${{ secrets.TEST_GHCR_USERNAME }}", "password": "${{ secrets.TEST_GHCR_PASSWORD }}" } | ||
} | ||
EOF | ||
kubectl create secret generic ghcr-secret \ | ||
--from-file=.dockercfg \ | ||
--type=kubernetes.io/dockercfg \ | ||
-o json --dry-run=client | jq -r '.data.".dockercfg"' > auth/legacy-ghcr.yaml | ||
- name: Unit tests | ||
run: make test | ||
run: | | ||
make test | ||
make test-registries | ||
- uses: codecov/codecov-action@v3 | ||
with: | ||
files: cover.out | ||
files: cover.out,cover-registries.out | ||
|
||
- name: Build image | ||
uses: docker/build-push-action@v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters