-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
21 lines (21 loc) · 1.04 KB
/
cloudbuild.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
steps:
# Build the container image
- name: 'eclipse-temurin:17-jdk-alpine'
entrypoint: 'sh'
args: [ '-c', './gradlew clean gnagCheck bootBuildImage -Partifactory_user=$$ARTIFACTORY_USER -Partifactory_password=$$ARTIFACTORY_PASSWORD -PimageTag=$COMMIT_SHA' ]
secretEnv: ['ARTIFACTORY_USER', 'ARTIFACTORY_PASSWORD']
# Push the container image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/gnag-website:$COMMIT_SHA']
# Deploy container image to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args: [ 'run', 'deploy', 'gnag-website', '--image', 'gcr.io/$PROJECT_ID/gnag-website:$COMMIT_SHA', '--region', 'us-central1' ]
availableSecrets:
secretManager:
- versionName: 'projects/$PROJECT_NUMBER/secrets/ARTIFACTORY_USER/versions/latest'
env: 'ARTIFACTORY_USER'
- versionName: 'projects/$PROJECT_NUMBER/secrets/ARTIFACTORY_PASSWORD/versions/latest'
env: 'ARTIFACTORY_PASSWORD'
images:
- 'gcr.io/$PROJECT_ID/gnag-website:$COMMIT_SHA'