Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate survey from GCR to GAR #159

Merged
merged 4 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ on:

env:
IMAGE: survey
REGISTRY_HOSTNAME: eu.gcr.io
HOST: ${{ secrets.GOOGLE_PROJECT_ID }}
RELEASE_HOST: ${{ secrets.RELEASE_PROJECT_ID }}
REGISTRY_HOSTNAME: europe-west2-docker.pkg.dev
SPINNAKER_GOOGLE_PROJECT_ID: ${{ secrets.SPINNAKER_GOOGLE_PROJECT_ID }}
GAR_REPOSITORY: images
GAR_GOOGLE_PROJECT_ID: ${{ secrets.GAR_GOOGLE_PROJECT_ID }}
CHART_DIRECTORY: _infra/helm/survey
SPINNAKER_TOPIC: ${{ secrets.SPINNAKER_TOPIC }}
ARTIFACT_BUCKET: ${{ secrets.ARTIFACT_BUCKET }}
Expand Down Expand Up @@ -44,7 +45,7 @@ jobs:
- name: Setup Google Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- run: |
gcloud auth configure-docker
gcloud auth configure-docker "$REGISTRY_HOSTNAME"
- name: pr docker tag
if: github.ref != 'refs/heads/main'
id: tag
Expand All @@ -57,11 +58,11 @@ jobs:
if: github.ref != 'refs/heads/main'
run: |
make build
docker build -t "$REGISTRY_HOSTNAME"/"$HOST"/"$IMAGE":${{ env.pr_number }} .
docker build -t "$REGISTRY_HOSTNAME"/"$GAR_GOOGLE_PROJECT_ID"/"$GAR_REPOSITORY"/"$IMAGE":${{ env.pr_number }} .
- name: Push dev image
if: github.ref != 'refs/heads/main'
run: |
docker push "$REGISTRY_HOSTNAME"/"$HOST"/"$IMAGE":${{ env.pr_number }}
docker push "$REGISTRY_HOSTNAME"/"$GAR_GOOGLE_PROJECT_ID"/"$GAR_REPOSITORY"/"$IMAGE":${{ env.pr_number }}
- name: template helm
run: |
helm template $CHART_DIRECTORY
Expand Down Expand Up @@ -164,12 +165,12 @@ jobs:
- name: Build Release Image
if: github.ref == 'refs/heads/main'
run: |
docker build -t "$REGISTRY_HOSTNAME"/"$RELEASE_HOST"/"$IMAGE":latest -t "$REGISTRY_HOSTNAME"/"$RELEASE_HOST"/"$IMAGE":${{ env.version }} .
docker build -f _infra/docker/Dockerfile -t "$REGISTRY_HOSTNAME"/"$GAR_GOOGLE_PROJECT_ID"/"$GAR_REPOSITORY"/"$IMAGE":latest -t "$REGISTRY_HOSTNAME"/"$GAR_GOOGLE_PROJECT_ID"/"$GAR_REPOSITORY"/"$IMAGE":${{ env.version }} .
- name: Push Release image
if: github.ref == 'refs/heads/main'
run: |
docker push "$REGISTRY_HOSTNAME"/"$RELEASE_HOST"/"$IMAGE":${{ env.version }}
docker push "$REGISTRY_HOSTNAME"/"$RELEASE_HOST"/"$IMAGE":latest
docker push "$REGISTRY_HOSTNAME"/"$GAR_GOOGLE_PROJECT_ID"/"$GAR_REPOSITORY"/"$IMAGE":${{ env.version }}
docker push "$REGISTRY_HOSTNAME"/"$GAR_GOOGLE_PROJECT_ID"/"$GAR_REPOSITORY"/"$IMAGE":latest

- name: Publish Charts
if: github.ref == 'refs/heads/main'
Expand All @@ -186,6 +187,6 @@ jobs:
- name: CD hook
if: github.ref == 'refs/heads/main'
run: |
gcloud pubsub topics publish $SPINNAKER_TOPIC --project $HOST \
gcloud pubsub topics publish $SPINNAKER_TOPIC --project $SPINNAKER_GOOGLE_PROJECT_ID \
--message "{ \"kind\": \"storage#object\", \"name\": \"$IMAGE/$IMAGE-${{ env.HELM_VERSION }}.tgz\", \"bucket\": \"$ARTIFACT_BUCKET\" }" \
--attribute cd="actions"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ clean:
if [ -d $(BUILD) ]; then rm -r $(BUILD); fi;

docker: build
docker build . -t eu.gcr.io/ons-rasrmbs-management
docker build . -t europe-west2-docker.pkg.dev/ons-ci-rmrasbs/images

4 changes: 2 additions & 2 deletions _infra/helm/survey/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 11.0.58
version: 11.0.59

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 11.0.58
appVersion: 11.0.59
4 changes: 2 additions & 2 deletions _infra/helm/survey/values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
env: minikube
namespace: minikube
image:
devRepo: eu.gcr.io/ons-rasrmbs-management
name: eu.gcr.io/ons-rasrmbs-management
devRepo: europe-west2-docker.pkg.dev/ons-ci-rmrasbs/images
name: europe-west2-docker.pkg.dev/ons-ci-rmrasbs/images
tag: latest
pullPolicy: Always

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:

survey:
container_name: surveysvc
image: eu.gcr.io/ons-rasrmbs-management/survey
image: europe-west2-docker.pkg.dev/ons-ci-rmrasbs/images/survey
ports:
- "8080:8080"
links:
Expand Down
Loading