mirror of
https://github.com/google/nomulus.git
synced 2025-08-03 16:32:11 +02:00
Add a CloudBuild task to deploy Beam pipeline
This commit is contained in:
parent
8ae67ed731
commit
ece6ae1d78
3 changed files with 84 additions and 13 deletions
55
release/cloudbuild-deploy-beam.yaml
Normal file
55
release/cloudbuild-deploy-beam.yaml
Normal file
|
@ -0,0 +1,55 @@
|
|||
# To run the build locally, install cloud-build-local first.
|
||||
# Then run:
|
||||
# cloud-build-local --config=cloudbuild-deploy-beam.yaml --dryrun=false \
|
||||
# --substitutions=TAG_NAME=[TAG],_CREDENTIAL_JSON=[CREDENTIAL_JSON],\
|
||||
# _CREDENTIAL_KEYRING=[CREDENTIAL_KEYRING],_CREDENTIAL_KEY=[CREDENTIAL_KEY],\
|
||||
# _ENV=[ENV] .
|
||||
#
|
||||
# This will deploy Beam pipelines to GCS for the PROJECT_ID defined in gcloud
|
||||
# tool.
|
||||
#
|
||||
# To manually trigger a build on GCB, run:
|
||||
# gcloud builds submit --config=cloudbuild-deploy-beam.yaml --substitutions=TAG_NAME=[TAG],\
|
||||
# _CREDENTIAL_JSON=[CREDENTIAL_JSON],_CREDENTIAL_KEYRING=[CREDENTIAL_KEYRING],\
|
||||
# _CREDENTIAL_KEY=[CREDENTIAL_KEY],_ENV=[ENV] .
|
||||
#
|
||||
# To trigger a build automatically, follow the instructions below and add a trigger:
|
||||
# https://cloud.google.com/cloud-build/docs/running-builds/automate-builds
|
||||
steps:
|
||||
# Pull the latest nomulus.jar to local
|
||||
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
||||
args:
|
||||
- gsutil
|
||||
- cp
|
||||
- gs://${PROJECT_ID}-deploy/${TAG_NAME}/nomulus.jar
|
||||
- .
|
||||
# Pull the credential for nomulus tool
|
||||
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
||||
args:
|
||||
- gsutil
|
||||
- cp
|
||||
- gs://${PROJECT_ID}-deploy/nomulus-credential/${_CREDENTIAL_JSON}
|
||||
- .
|
||||
# Decrypt the credential
|
||||
- name: 'gcr.io/cloud-builders/gcloud'
|
||||
args:
|
||||
- kms
|
||||
- decrypt
|
||||
- --ciphertext-file=${_CREDENTIAL_JSON}
|
||||
- --plaintext-file=nomulus-credential.json
|
||||
- --location=global
|
||||
- --keyring=${_CREDENTIAL_KEYRING}
|
||||
- --key=${_CREDENTIAL_KEY}
|
||||
# Deploy spec11 and invoicing pipeline to GCS
|
||||
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
||||
entrypoint: /bin/bash
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
java -jar nomulus.jar -e ${_ENV} --credential nomulus-credential.json \
|
||||
deploy_spec11_pipeline
|
||||
java -jar nomulus.jar -e ${_ENV} --credential nomulus-credential.json \
|
||||
deploy_invoicing_pipeline
|
||||
timeout: 3600s
|
||||
options:
|
||||
machineType: 'N1_HIGHCPU_8'
|
Loading…
Add table
Add a link
Reference in a new issue