Skip to content

Commit

Permalink
chore: migrate to Artifact Registry (#571)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomhajile authored Mar 8, 2024
1 parent 20797c8 commit ae7e7b0
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 203 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-google-cloud/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ runs:
gcloud config set run/region ${{ inputs.project-zone }}
gcloud config set container/cluster ${{ inputs.project-cluster }}
gcloud container clusters get-credentials ${{ inputs.project-cluster }}
gcloud auth configure-docker gcr.io
gcloud auth configure-docker us-central1-docker.pkg.dev
shell: bash
9 changes: 0 additions & 9 deletions .github/workflows/snackager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ jobs:
env:
SKAFFOLD_PUSH_IMAGE: 'true'

- name: 🧹 Dry-run prune docker image
run: ./bin/prune-gcr snackager --dry-run
working-directory: ./

- name: 📋 Add change cause
run: kustomize edit add annotation kubernetes.io/change-cause:"Github Actions deploying $GITHUB_SHA at $(date)"
working-directory: snackager/k8s/staging
Expand Down Expand Up @@ -189,11 +185,6 @@ jobs:
ENVIRONMENT: production
SKAFFOLD_PUSH_IMAGE: 'true'

- name: 🧹 Prune docker image
if: ${{ success() }}
run: ./bin/prune-gcr snackager
working-directory: ./

- name: 💬 Notify Slack
if: ${{ always() }}
uses: 8398a7/action-slack@v3
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/snackpub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ jobs:
env:
SKAFFOLD_PUSH_IMAGE: 'true'

- name: 🧹 Dry-run prune docker image
run: ./bin/prune-gcr snackpub --dry-run
working-directory: ./

- name: 🚀 Deploy snackpub to k8s
run: skaffold deploy --status-check --build-artifacts /tmp/build.json
working-directory: snackpub
Expand Down Expand Up @@ -152,11 +148,6 @@ jobs:
env:
ENVIRONMENT: production

- name: 🧹 Prune docker image
if: ${{ success() }}
run: ./bin/prune-gcr snackpub
working-directory: ./

- name: 💬 Notify Slack
if: ${{ always() }}
uses: 8398a7/action-slack@v3
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ jobs:
env:
SKAFFOLD_PUSH_IMAGE: 'true'

- name: 🧹 Dry-run prune docker image
run: ./bin/prune-gcr snack --dry-run
working-directory: ./

- name: 📋 Add change cause
run: kustomize edit add annotation kubernetes.io/change-cause:"Github Actions deploying $GITHUB_SHA at $(date)"
working-directory: website/deploy/staging
Expand Down Expand Up @@ -183,11 +179,6 @@ jobs:
ENVIRONMENT: production
SKAFFOLD_PUSH_IMAGE: 'true'

- name: 🧹 Prune docker image
if: ${{ success() }}
run: ./bin/prune-gcr snack
working-directory: ./

- name: 💬 Notify Slack
uses: 8398a7/action-slack@v3
if: ${{ always() }}
Expand Down
166 changes: 0 additions & 166 deletions bin/prune-gcr

This file was deleted.

2 changes: 1 addition & 1 deletion snackager/k8s/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
defaultMode: 0600
containers:
- name: snackager
image: "gcr.io/exponentjs/snackager:SetInKustomizeYaml"
image: "us-central1-docker.pkg.dev/exponentjs/snack/snackager:SetInKustomizeYaml"
volumeMounts:
- mountPath: /var/secrets/github
name: instance-credentials
Expand Down
2 changes: 1 addition & 1 deletion snackager/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: snackager
build:
artifacts:
- image: gcr.io/exponentjs/snackager
- image: us-central1-docker.pkg.dev/exponentjs/snack/snackager
sync:
manual:
- src: src/**/*.js
Expand Down
4 changes: 2 additions & 2 deletions snackager/test_with_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [[ -z "$tag" ]]
then
tag="$(env LC_CTYPE=C tr -dc 'a-zA-Z0-9' </dev/urandom | fold -w 32 | head -n 1)"
echo "no tag specified, building docker image with tag $tag"
gcloud docker -- build -t "gcr.io/exponentjs/snackager:$tag" .
gcloud docker -- build -t "us-central1-docker.pkg.dev/exponentjs/snack/snackager:$tag" .
fi

docker run -t -w="/app" "gcr.io/exponentjs/snackager:$tag" yarn bundle "$package"
docker run -t -w="/app" "us-central1-docker.pkg.dev/exponentjs/snack/snackager:$tag" yarn bundle "$package"
2 changes: 1 addition & 1 deletion snackpub/k8s/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
restartPolicy: Always
containers:
- name: snackpub
image: gcr.io/exponentjs/snackpub:SetBySkaffold
image: us-central1-docker.pkg.dev/exponentjs/snack/snackpub:SetBySkaffold
imagePullPolicy: Always
envFrom:
- secretRef:
Expand Down
2 changes: 1 addition & 1 deletion snackpub/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
build:
platforms: ['linux/amd64']
artifacts:
- image: gcr.io/exponentjs/snackpub
- image: us-central1-docker.pkg.dev/exponentjs/snack/snackpub
sync:
manual:
- src: src/**/*
Expand Down
2 changes: 1 addition & 1 deletion website/deploy/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
restartPolicy: Always
containers:
- name: snack
image: gcr.io/exponentjs/snack:SetBySkaffold
image: us-central1-docker.pkg.dev/exponentjs/snack/snack:SetBySkaffold
envFrom:
- configMapRef:
name: snack
Expand Down
4 changes: 2 additions & 2 deletions website/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: snack
build:
artifacts:
- image: gcr.io/exponentjs/snack
- image: us-central1-docker.pkg.dev/exponentjs/snack/snack
sync:
manual:
- src: src/**/*
Expand Down Expand Up @@ -40,7 +40,7 @@ profiles:
- name: prod
build:
artifacts:
- image: gcr.io/exponentjs/snack
- image: us-central1-docker.pkg.dev/exponentjs/snack/snack
docker:
dockerfile: website/Dockerfile
buildArgs:
Expand Down

0 comments on commit ae7e7b0

Please sign in to comment.