-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudbuild.yaml
49 lines (47 loc) · 1.65 KB
/
cloudbuild.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
steps:
- name: docker
id: build_and_push
entrypoint: sh
args:
- "-c"
- |
if [ $_ENV = "staging" ]; then
docker build -t "$_EQ_EXTRACT_QUESTIONS_IMAGE_REPO:$SHORT_SHA" .
docker push "$_EQ_EXTRACT_QUESTIONS_IMAGE_REPO:$SHORT_SHA"
else
echo "*************************************************************"
echo "* Build not required *"
echo "*************************************************************"
fi
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk:alpine"
id: tag release
entrypoint: /bin/bash
args:
- "-c"
- |
if [ $_ENV = "preprod" ]; then
gcloud container images add-tag \
$_EQ_EXTRACT_QUESTIONS_IMAGE_REPO:$SHORT_SHA \
$_EQ_EXTRACT_QUESTIONS_IMAGE_REPO:$TAG_NAME
else
echo "*************************************************************"
echo "* Tagging not required *"
echo "*************************************************************"
fi
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk:alpine"
id: deploy
entrypoint: sh
args:
- "-c"
- |
if [ $_ENV = "staging" ]; then
gcloud run deploy eq-extract-questions \
--image "$_EQ_EXTRACT_QUESTIONS_IMAGE_REPO:$SHORT_SHA" \
--region europe-west2 \
--platform managed
else
gcloud run deploy eq-extract-questions \
--image "$_EQ_EXTRACT_QUESTIONS_IMAGE_REPO:$TAG_NAME" \
--region europe-west2 \
--platform managed
fi