Skip to content
Snippets Groups Projects
Commit 39dbe064 authored by Florian Warninghoff's avatar Florian Warninghoff
Browse files

Merge branch 'HOLI-4402_switch-to-artifactregistry' into 'main'

HOLI-4402 switch to artifactregistry

See merge request holisticfoundation/holi-unified-api!32
parents 366ea49e 9e37106d
No related branches found
No related tags found
No related merge requests found
......@@ -76,12 +76,12 @@ build_docker:
- docker:20.10-dind
variables:
# this could be fetched via terraform output ("gcr_location" in infra project), but then we would need an extra job for terraform
GCR_IMAGE: eu.gcr.io/holi-shared/holi-unified-api
GCR_IMAGE: europe-north1-docker.pkg.dev/holi-shared/docker/holi-unified-api
before_script:
- cat $GOOGLE_CLOUD_SERVICE_ACCOUNT | docker login -u _json_key --password-stdin https://eu.gcr.io
- cat $GOOGLE_CLOUD_SERVICE_ACCOUNT | docker login -u _json_key --password-stdin https://europe-north1-docker.pkg.dev
script:
- docker pull $GCR_IMAGE || true # Allows us to use --cache-from
- docker build --cache-from $GCR_IMAGE -t $GCR_IMAGE:$CI_COMMIT_SHA -t $GCR_IMAGE:$CI_COMMIT_REF_SLUG .
- docker pull $GCR_IMAGE || true # Allows us to use --cache-from, we need to tag with latest in the next command for this to work
- docker build --cache-from $GCR_IMAGE -t $GCR_IMAGE:latest -t $GCR_IMAGE:$CI_COMMIT_SHA -t $GCR_IMAGE:$CI_COMMIT_REF_SLUG .
- docker push $GCR_IMAGE:$CI_COMMIT_SHA # this is the tag that is used for deployment
- docker push $GCR_IMAGE:$CI_COMMIT_REF_SLUG # just for easyly knowing which is the last image for a branch
......
......@@ -40,7 +40,7 @@ resource "google_cloud_run_service" "unified_api" {
spec {
service_account_name = data.terraform_remote_state.holi_unified_api_common_state.outputs.cloud_run_service_account_email
containers {
image = "${data.terraform_remote_state.holi_infra_state.outputs.gcr_location}/holi-unified-api:${var.image_tag}"
image = "${data.terraform_remote_state.holi_infra_state.outputs.artifact_registry_location}/holi-unified-api:${var.image_tag}"
ports {
container_port = 4455
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment