Permalink
Browse files

Make Cloud Build produce artifact ready for Spinnaker to consume

The artifacts for each service will be packaged inside a tar file that, when untared, is ready for Spinnaker to deploy to GAE.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=226516223
  • Loading branch information...
jianglai authored and mindhog committed Dec 21, 2018
1 parent 3d3c0eb commit a09067c51dbe967dcc04f4b38da6a9e0ccce2fb0
Showing with 24 additions and 21 deletions.
  1. +21 −20 cloudbuild-nomulus.yaml
  2. +3 −1 gradle/build.gradle
@@ -22,31 +22,32 @@ steps:
args: ['source', 'repos', 'clone', 'nomulus-config']
- name: 'alpine'
args: ['sh', '-c', 'cp -r nomulus-config/* .']
# Build the war files.
- name: 'openjdk:8-slim'
# Build the deployment files.
- name: 'google/cloud-sdk'
args: ['./gradlew', 'stage', '-x', 'autoLintGradle']
dir: 'gradle'
- name: 'openjdk:8-slim'
args: ['jar', '-cvf', '../../../default-${TAG_NAME}.war', '.']
dir: 'gradle/services/default/build/exploded-default'
- name: 'openjdk:8-slim'
args: ['jar', '-cvf', '../../../pubapi-${TAG_NAME}.war', '.']
dir: 'gradle/services/pubapi/build/exploded-pubapi'
- name: 'openjdk:8-slim'
args: ['jar', '-cvf', '../../../backend-${TAG_NAME}.war', '.']
dir: 'gradle/services/backend/build/exploded-backend'
- name: 'openjdk:8-slim'
args: ['jar', '-cvf', '../../../tools-${TAG_NAME}.war', '.']
dir: 'gradle/services/tools/build/exploded-tools'
# WAR files to upload to GCS.
# Tar the deployment files as we cannot upload directories to GCS.
- name: 'alpine'
args: ['tar', 'cvf', '../../../default.tar', '.']
dir: 'gradle/services/default/build/staged-app'
- name: 'alpine'
args: ['tar', 'cvf', '../../../pubapi.tar', '.']
dir: 'gradle/services/pubapi/build/staged-app'
- name: 'alpine'
args: ['tar', 'cvf', '../../../backend.tar', '.']
dir: 'gradle/services/backend/build/staged-app'
- name: 'alpine'
args: ['tar', 'cvf', '../../../tools.tar', '.']
dir: 'gradle/services/tools/build/staged-app'
# Tar files to upload to GCS.
artifacts:
objects:
location: 'gs://${PROJECT_ID}-war'
location: 'gs://${PROJECT_ID}-deploy/${TAG_NAME}'
paths:
- 'gradle/services/default-${TAG_NAME}.war'
- 'gradle/services/pubapi-${TAG_NAME}.war'
- 'gradle/services/backend-${TAG_NAME}.war'
- 'gradle/services/tools-${TAG_NAME}.war'
- 'gradle/services/default.tar'
- 'gradle/services/pubapi.tar'
- 'gradle/services/backend.tar'
- 'gradle/services/tools.tar'
timeout: 3600s
options:
machineType: 'N1_HIGHCPU_8'
@@ -91,7 +91,7 @@ subprojects {
}

rootProject.deploy.dependsOn appengineDeploy
rootProject.stage.dependsOn explodeWar
rootProject.stage.dependsOn appengineStage

// Return early, do not apply the settings below.
return
@@ -107,6 +107,8 @@ subprojects {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'

compileJava {options.encoding = "UTF-8"}

gradleLint.rules = [
// Checks if Gradle wrapper is up-to-date
'archaic-wrapper',

0 comments on commit a09067c

Please sign in to comment.