Bruce Wilcox
Bruce Wilcox

Reputation: 441

What are the applicable 'cloudbuild.yaml' steps to deploy a Java App to Google App Engine Standard edition?

What are the applicable 'cloudbuild.yaml' steps to deploy a Java App to Google App Engine Standard edition?

I cannot find anything specific to this in the documentation.

I am trying:

steps:
  - name: 'gcr.io/cloud-builders/mvn'
    args: [ 'install', '--settings', 'settings.xml' ]
  - name: 'gcr.io/cloud-builders/gcloud'
    args: [ 'app', 'deploy' ]
    timeout: '6m0s'

The first step succeeds but the second step fails with this less-than-helpful message:

Already have image (with digest): gcr.io/cloud-builders/gcloud
ERROR: gcloud crashed (AttributeError): 'NoneType' object has no attribute 'endswith'

Should I use the maven deploy command 'mvn appengine:deploy' instead?

Thank you in advance.


A second attempt:

steps:
  - name: 'gcr.io/cloud-builders/mvn'
    args: [ '--define', 'skipTests', '--settings', 'settings.xml', 
'clean', 'package', 'appengine:deploy' ]
    timeout: '6m0s'

With this result:

Execution default-cli of goal 
com.google.cloud.tools:appengine-maven-plugin:1.3.1:deploy 
failed: 
The Google Cloud SDK could not be found 
in the customary locations and no path was provided.

Upvotes: 1

Views: 815

Answers (1)

Bruce Wilcox
Bruce Wilcox

Reputation: 441

I found the answer at:

https://medium.com/@Leejjon_net/use-cloud-build-to-do-continuous-delivery-for-your-java-project-on-app-engine-3c59072547ca

steps:
  - id: 'Stage app using mvn appengine plugin'
    name: 'gcr.io/cloud-builders/mvn'
    args: [ '--define', 'skipTests', '--settings', 'settings.xml', 'package', 'appengine:stage' ]
  - id: 'Deploy to app engine'
    name: 'gcr.io/cloud-builders/gcloud'
    args: [ 'app', 'deploy', 'target/appengine-staging/app.yaml' ]

Also, make sure version of plug in is:

   <plugin>
       <groupId>com.google.cloud.tools</groupId>
       <artifactId>appengine-maven-plugin</artifactId>
       <version>2.2.0</version>
   </plugin>

Upvotes: 2

Related Questions