Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Pipeline for deploy with Maven on appengine

Cédric Godefroy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 27, 2018

Hello,

I have a problem with Bitbucket Pipeline in order to deploy on appengine with maven.

I have follow the steps describe on the documentation (Bitbucket documentation on appengine), but when the last instruction is executed (instruction deployment : "mvn gae:update" or "mvn appengine:update"), the console ask to open a browser in order to obtain a key and the pipeline fails:

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-platformAttempting 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 foundPlease see the logs [/tmp/appcfg4378383241450731188.log] for further information.

I try a lot of solutions, the most pertinent, I have found, is to modify the "~/.appcfg_oauth2_tokens_java" file, in order to give maven the key it neeeds. The modification work fine on my local computer, but not on the bitbucket Pipeline.

Can you help me please?

Regards. CG

PS : Here is my bitbucket-pipelines.yml file :

pipelines:
default:
- step:
image: maven:3.5.2-jdk-7
script :

- 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 $GCLOUD_API_KEYFILE | base64 --decode --ignore-garbage > ./gcloud-api-key.json
- gcloud auth activate-service-account --key-file gcloud-api-key.json
# Linking to the Google Cloud project
- gcloud config set project $GCLOUD_PROJECT
# Deploying the application
- gcloud components install app-engine-java
- 'mvn gae:unpack'
- echo '{"credentials":{"cedricgodefroy":{"access_token":"XXXX","expiration_time_millis":1517055571188,"refresh_token":"XXX"}}}' > ~/.appcfg_oauth2_tokens_java
- 'mvn clean gae:update'

 

1 answer

0 votes
Henry Johnson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 2, 2019

Did you find a solution?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events