【发布时间】:2017-12-27 09:01:49
【问题描述】:
我有一个java web应用部署在app engine,源码在Bitbucketmaster branch下,
我听说过bitbucket pipelines,我发现它作为一种快速的自动部署方式很有帮助
我的主分支有 4 个项目的列表:
master --
|- project1
|- project2
|- project3
|- project4
|- bitbucket-pipelines.yml
我完全按照此链接中所写的内容来提供管道功能:
https://confluence.atlassian.com/bitbucket/deploy-to-google-cloud-900820342.html
这是我的bitbucket-pipelines.yml 内容,它直接位于我的主分支下
image: maven:3.3.9
pipelines:
branches:
master:
- step:
caches:
- maven
script:
# Downloading the Google Cloud SDK
- curl -o /tmp/google-cloud-sdk.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-155.0.0-linux-x86_64.tar.gz
- tar -xvf /tmp/google-cloud-sdk.tar.gz -C /tmp/
- /tmp/google-cloud-sdk/install.sh -q
- source /tmp/google-cloud-sdk/path.bash.inc
# Authenticating with the service account key file
- echo $GOOGLE_CLIENT_SECRET | base64 --decode --ignore-garbage > ./gcloud-api-key.json
- gcloud config set project $CLOUDSDK_CORE_PROJECT
- gcloud components install app-engine-java
- gcloud auth activate-service-account --key-file client-secret.json
- cd project1
- mvn clean install package
- 'mvn appengine:update'
CLOUDSDK_CORE_PROJECT :是一个管道变量,包含项目 ID GOOGLE_CLIENT_SECRET :是一个管道变量,包含 base64 编码的服务帐户 json 文件,如附加链接中所述
这是我在 pom.xml 中的应用引擎插件
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.target.version}</version>
<configuration>
<enableJarClasses>false</enableJarClasses>
<oauth2>false</oauth2>
</configuration>
</plugin>
在我运行管道后,执行“mvn appengine:update”行时出现此错误
lease visit https://developers.google.com/appengine/downloads for the latest SDK.
********************************************************
The following URL can be used to authenticate:
https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force&client_id=550516889912.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=https://www.googleapis.com/auth/appengine.admin%20https://www.googleapis.com/auth/cloud-platform
Attempting to open it in your browser now.
Unable to open browser. Please open the URL above and copy the resulting code.
Please enter code: Encountered a problem: No line found
Please see the logs [/tmp/appcfg3177766291803906341.log] for further information.
然后流水线结果失败,找了2天这个错误没有希望,希望来人帮帮我
提前致谢!
【问题讨论】:
标签: java google-app-engine bitbucket-pipelines