gpt4 book ai didi

google-container-registry - 谷歌云构建器-Gradle

转载 作者:行者123 更新时间:2023-12-05 01:18:34 25 4
gpt4 key购买 nike

关注 https://cloudplatform.googleblog.com/2017/03/Google-Cloud-Container-Builder-a-fast-and-flexible-way-to-package-your-software.html 的帖子

我了解 Google Container Builder 支持 Gradle。但是我找不到任何例子。我特别感兴趣的是在构建中明确设置 gradle 版本。

最佳答案

我们在 Google Cloud Container Builder 中使用 Gradle 构建 Spinnaker 组件。

我们在 GitHub 存储库中 checkin 了一个 Gradle 包装器,我们在 gradle-wrapper.properties 文件的 distributionUrl 中设置了版本:

#Thu Nov 12 15:41:58 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip

来源:https://github.com/spinnaker/gate/blob/master/gradle/wrapper/gradle-wrapper.properties

然后我们正常调用./gradlew。这是来自同一存储库的 cloudbuild.yaml 示例:

steps:
- name: 'java:8'
env: ["GRADLE_USER_HOME=cache"]
entrypoint: "bash"
args: [ "-c", "./gradlew gate-web:installDist -x test"]
- name: 'gcr.io/cloud-builders/docker'
args: ["build", "-t", "gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA", "-t", "gcr.io/$PROJECT_ID/$REPO_NAME:latest", "-f", "Dockerfile.slim", "."]
images:
- 'gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/$REPO_NAME:latest'

来源:https://github.com/spinnaker/gate/blob/master/cloudbuild.yaml

关于google-container-registry - 谷歌云构建器-Gradle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42638864/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com