-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
38 lines (34 loc) · 1.41 KB
/
.gitlab-ci.yml
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
image: google/cloud-sdk:alpine
stages:
- deploy
default:
before_script:
- curl -s https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer | bash
- gcloud auth activate-service-account --key-file .secure_files/maximal-radius-375114-f09823b3e627.json
after_script:
- rm -rf .secret_files
deploy_application:
stage: deploy
only:
- main
script:
- echo $DB_PASSWD > src/main/resources/db_passwd
- echo "$CI_COMMIT_BRANCH:$CI_COMMIT_SHORT_SHA" > src/main/resources/version
- echo "$CI_COMMIT_MESSAGE" >> src/main/resources/version
- echo "$CI_JOB_STARTED_AT" >> src/main/resources/version
- cp .secure_files/maximal-radius-375114-f09823b3e627.json src/main/resources/gcp-credentials.json
- gcloud --quiet --project "$PROJECT_ID" app deploy app.yaml
deploy_invoicing_function:
stage: deploy
only:
- main
script:
- cd invoicing-function
- gcloud functions deploy invoicing-function --project "$PROJECT_ID" --quiet --max-instances 1 --entry-point $(cat functionMainClass) --region europe-west3 --runtime java17 --trigger-http --memory 512MB
deploy_bi_function:
stage: deploy
only:
- main
script:
- cd bi-function
- gcloud functions deploy bi-function --project "$PROJECT_ID" --quiet --max-instances 1 --entry-point $(cat functionMainClass) --region europe-west3 --runtime java17 --trigger-http --memory 512MB