mirror of
https://github.com/google/nomulus.git
synced 2025-08-06 01:35:17 +02:00
The pipeline is broken into two. The first one is to be triggered when the public repo is tagged. It then tags the private repo, builds and upload the builder and base images, and push a new commit to the release (merged repo). This pipeline also does text manipulation on several files in the release repo to ensure that the images uploaded in this pipeline is always used to reproducibly build the release repo at the same commit. The second pipeline is then triggered by commit into the release repo, which builds, signs and uploads the proxy image. Also updated the dependency lock files to use the latest plugins dependencies, which are uploaded to the GCS repo. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=244666211
73 lines
2.6 KiB
YAML
73 lines
2.6 KiB
YAML
# To run the build locally, install cloud-build-local first.
|
|
# See: https://cloud.google.com/cloud-build/docs/build-debug-locally
|
|
# You will need access to a private registry, so be sure to install the docker
|
|
# credential helper.
|
|
# Then, in the root of a nomulus source tree, run:
|
|
# cloud-build-local --config=cloudbuild-nomulus.yaml --dryrun=false --substitutions TAG_NAME=[TAG] .
|
|
# This will build the contents of the current directory and generate the
|
|
# nomulus war-files locally.
|
|
# The PROJECT_ID is the current project name that gcloud uses.
|
|
# You can add "--push true" to have the image pushed to GCR.
|
|
#
|
|
# To manually trigger a build on GCB, run:
|
|
# gcloud builds submit --config cloudbuild-nomulus.yaml --substitutions TAG_NAME=[TAG] .
|
|
#
|
|
# 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:
|
|
# Set permissions correctly. Not sure why it is necessary, but it is.
|
|
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
|
entrypoint: /bin/bash
|
|
args: ['chown', '-R', 'root:root', '.']
|
|
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
|
entrypoint: /bin/bash
|
|
args: ['chmod', '-R', '777', '.']
|
|
# Create a directory to store the artifacts
|
|
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
|
entrypoint: /bin/bash
|
|
args: ['mkdir', 'nomulus']
|
|
# Run tests
|
|
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
|
args: ['./gradlew', 'test']
|
|
dir: 'gradle'
|
|
# Build the deployment files for sandbox.
|
|
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
|
args:
|
|
- './gradlew'
|
|
- 'stage'
|
|
- '-x'
|
|
- 'autoLintGradle'
|
|
- '-Penvironment=sandbox'
|
|
- '-PmavenUrl=gcs://domain-registry-maven-repository/maven'
|
|
- '-PpluginsUrl=gcs://domain-registry-maven-repository/plugins'
|
|
dir: 'gradle'
|
|
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
|
entrypoint: bin/bash
|
|
args: ['./move_artifacts.sh', 'sandbox', 'nomulus']
|
|
# Build the deployment files for crash.
|
|
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
|
args:
|
|
- './gradlew'
|
|
- 'stage'
|
|
- '-x'
|
|
- 'autoLintGradle'
|
|
- '-Penvironment=crash'
|
|
- '-PmavenUrl=gcs://domain-registry-maven-repository/maven'
|
|
- '-PpluginsUrl=gcs://domain-registry-maven-repository/plugins'
|
|
dir: 'gradle'
|
|
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
|
entrypoint: bin/bash
|
|
args: ['./move_artifacts.sh', 'crash', 'nomulus']
|
|
# Create the uber tarball including all environments.
|
|
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
|
entrypoint: bin/bash
|
|
args: ['tar', 'cvf', '../nomulus.tar', '.']
|
|
dir: 'nomulus'
|
|
# The tarball to upload to GCS.
|
|
artifacts:
|
|
objects:
|
|
location: 'gs://${PROJECT_ID}-deploy/${TAG_NAME}'
|
|
paths: ['nomulus.tar']
|
|
timeout: 3600s
|
|
options:
|
|
machineType: 'N1_HIGHCPU_8'
|