mvn appengine:Bamboo的更新需要凭据

时间:2015-05-14 10:31:10

标签: google-app-engine amazon-ec2 bamboo

我有一个使用war更新appspot的maven项目,但是当Atlassian Cloud Bamboo执行构建时,OAuth身份验证会提示访问令牌。

14-May-2015 00:17:18    [INFO] Retrieving Google App Engine Java SDK from Maven
14-May-2015 00:17:18    [INFO] Updating Google App Engine Application
14-May-2015 00:17:18    [INFO] Running -V 1.9.20 --oauth2 update /mnt/bamboo-ebs/bamboo-agent/build-dir/[project path]-1-SNAPSHOT
14-May-2015 00:17:21    Please open the following URL in your browser:
14-May-2015 00:17:21      https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force&client_id=XXXXXXXX.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

打开网址我可以获得访问令牌,但我无法输入,因此构建会一直挂起,直到取消。

我应该如何设置身份验证?

1 个答案:

答案 0 :(得分:0)

将誓言凭据添加到EBS附加卷,并在代理启动时将其复制到位。

  1. Configure bamboo用于EBS附加卷
  2. SSH into实例,su给竹子用户
  3. Download Appengine SDK
  4. Run appcfg提示进行身份验证
    1. appcfg -s my-app.appspot.com version
    2. 按照oauth的说明创建/home/bamboo/.appcfg_oauth2_tokens_java
  5. mkdir / mnt / bamboo-ebs / appengine
  6. cp /home/bamboo/.appcfg_oauth2_tokens_java / mnt / bamboo-ebs / appengine
  7. 编辑/mnt/bamboo-ebs/bin/customize-extras.sh(参见docs)添加以下内容
    1. cp /mnt/bamboo-ebs/appengine/.appcfg_oauth2_tokens_java / home / bamboo /
    2. chown bamboo:bamboo /home/bamboo/.appcfg_oauth2_tokens_java
  8. 拍摄卷的快照并将快照分配给您的Bamboo实例配置
  9. 下次启动一个新实例时,将运行customize-extras.sh,并为mvn appengine提供必要的凭据:update to find。