Skip to content

Commit

Permalink
Merge pull request #222 from ONSdigital/EAR-2546-cloud-script-updates
Browse files Browse the repository at this point in the history
EAR 2546 Update cloudbuild script
  • Loading branch information
farres1 authored Dec 16, 2024
2 parents f5d496a + 85e7bfc commit ded4ee3
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,48 @@ steps:
- name: docker
id: build_and_push
entrypoint: sh
args:
- '-c'
args:
- "-c"
- |
if [ $_ENV = "staging" ]; then
docker build -t "eu.gcr.io/ons-eqbs-images/eq-publisher:$SHORT_SHA" .
docker push "eu.gcr.io/ons-eqbs-images/eq-publisher:$SHORT_SHA"
docker build -t "$_EQ_PUBLISHER_IMAGE_REPO:$SHORT_SHA" .
docker push "$_EQ_PUBLISHER_IMAGE_REPO:$SHORT_SHA"
else
echo "*************************************************************"
echo "* Build not required *"
echo "*************************************************************"
fi
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:alpine'
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk:alpine"
id: tag release
entrypoint: /bin/bash
args:
- '-c'
- "-c"
- |
if [ $_ENV = "preprod" ]; then
gcloud container images add-tag \
eu.gcr.io/ons-eqbs-images/eq-publisher:$SHORT_SHA \
eu.gcr.io/ons-eqbs-images/eq-publisher:$TAG_NAME
$_EQ_PUBLISHER_IMAGE_REPO:$SHORT_SHA \
$_EQ_PUBLISHER_IMAGE_REPO:$TAG_NAME
else
echo "*************************************************************"
echo "* Tagging not required *"
echo "*************************************************************"
fi
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:alpine'
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk:alpine"
id: deploy
entrypoint: sh
args:
- '-c'
- "-c"
- |
if [ $_ENV = "staging" ]; then
gcloud run deploy eq-publisher \
--image "eu.gcr.io/ons-eqbs-images/eq-publisher:$SHORT_SHA" \
--image "$_EQ_PUBLISHER_IMAGE_REPO:$SHORT_SHA" \
--region europe-west2 \
--platform managed
else
gcloud run deploy eq-publisher \
--image "eu.gcr.io/ons-eqbs-images/eq-publisher:$TAG_NAME" \
--image "$_EQ_PUBLISHER_IMAGE_REPO:$TAG_NAME" \
--region europe-west2 \
--platform managed
fi

0 comments on commit ded4ee3

Please sign in to comment.