mirror of
https://github.com/google/nomulus.git
synced 2025-07-21 18:26:12 +02:00
Build proxy image in Gradle (#179)
This commit is contained in:
parent
30f6113b05
commit
8fd5ab2bec
2 changed files with 15 additions and 11 deletions
|
@ -16,7 +16,11 @@ apply plugin: 'java'
|
|||
|
||||
createUberJar('deployJar', 'proxy_server', 'google.registry.proxy.ProxyServer')
|
||||
|
||||
project.build.dependsOn deployJar
|
||||
task buildProxyImage(dependsOn: deployJar, type: Exec) {
|
||||
commandLine 'docker', 'build', '-t', 'proxy', '.'
|
||||
}
|
||||
|
||||
project.build.dependsOn buildProxyImage
|
||||
|
||||
dependencies {
|
||||
def deps = rootProject.dependencyMap
|
||||
|
|
|
@ -13,24 +13,24 @@
|
|||
# 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.
|
||||
# Build the deploy jar.
|
||||
# Build the proxy docker image.
|
||||
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
||||
args:
|
||||
- './gradlew'
|
||||
- ':proxy:test'
|
||||
- ':proxy:deployJar'
|
||||
- ':proxy:buildProxyImage'
|
||||
- '-PmavenUrl=https://storage.googleapis.com/domain-registry-maven-repository/maven'
|
||||
- '-PpluginsUrl=https://storage.googleapis.com/domain-registry-maven-repository/plugins'
|
||||
# Build the docker image.
|
||||
# Tag and push the image. We can't let Cloud Build's default processing do that for us
|
||||
# because we need to push the image before we can sign it in the following step.
|
||||
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
||||
args: ['docker', 'build', '--tag', 'gcr.io/${PROJECT_ID}/proxy:${TAG_NAME}', '.']
|
||||
entrypoint: /bin/bash
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
docker tag proxy gcr.io/${PROJECT_ID}/proxy:${TAG_NAME}
|
||||
docker push gcr.io/${PROJECT_ID}/proxy:${TAG_NAME}
|
||||
dir: 'proxy'
|
||||
# Push the image. We can't let Cloud Build's default processing do that for us
|
||||
# because we need to push the image before we can sign it in the following
|
||||
# step.
|
||||
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
||||
args: ['docker', 'push', 'gcr.io/${PROJECT_ID}/proxy:${TAG_NAME}']
|
||||
# Get the image digest, sign it and substitute in the digest in the tagging yaml file.
|
||||
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
|
||||
entrypoint: /bin/bash
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue