last day (14 days later) » 

00:24
2
A: Deploying to Google App Engine

anonymous4444It's failing to deploy because your jenkins build script is failing: Build step 'Execute shell' marked build as failure During the step "Execute shell", you have to make sure that the script returns with status 0. Anything else is considered failure. See this SO answer to a similar issue. It a...

Man of the year is: @anonymous4444! I have almost lost all my hair the past days because of this. Thank you so much. So the documentation is wrong at Google.
Ah great! I'm so glad to hear this worked out for you. Out of interest, could you link the docs page that referred you to use the .war file instead of the WAR-structured folder? (PS - send bounty plox?)
You will get the bounty (I have to wait 12 hours before I can give it to you). Yes; cloud.google.com/tools/repo/push-to-deploy Search for: gcloud --project=<project-id> preview app deploy target/*.war
Thanks so much, yeah I'm gonna use the "report documentation issue" link to flag this. Thanks for the confirm on the bounty send (delicious internet points) and good luck with your app.
I have done it already. But you could do it as well.
One question though; It now works, but it doesn't seem like pushing changes cause Jenkins to start a new build. Do I need to do something special?
It works when I use the poll option, but that runs on intervals. Should push to Git also start a build?
00:24
You will need to go into "Releases" in the Developers Console under "Source Code" and configure the release pipeline there. If you linked your git repo, and you have selected "Java: Use Maven to build, test, and deploy", there's nothing left to do. Each time you push, the jenkins GCE instance will be spawned/supplied with your work, and it will build, test, and finally deploy your app. If your jenkins instance is somehow blocked, you could always try to delete it in the compute engine instances section.
Ah, so the release pipeline also needs to be configured for use togehter with Jenkins?
Hi
Sounds about right. Did you not have it configured this way before? How was a jenkins build running if you hadn't configured your repo to spin one up when the code was pushed?
I have followed this guide: cloud.google.com/tools/repo/push-to-deploy
doing all the steps
I manually triggered the build
inside jenkins
where is jenkins running? on your own computer?
No
In the cloud
compute engine
I followed the guide
gcloud compute \
    instances create bitnami-jenkins \
    --project ${PROJECT_ID} \
    --image-project bitnami-launchpad \
    --image bitnami-jenkins-1-587-0-linux-debian-7-x86-64-image \
    --zone us-central1-a \
    --machine-type n1-standard-1 \
    --metadata "bitnami-base-password=${PASSWORD}" \
               "bitnami-default-user=user" \
               "bitnami-key=jenkins" \
               "bitnami-name=Jenkins" \
               "bitnami-version=1-587-0" \
               "bitnami-url=//bitnami.com/stack/jenkins" \
00:27
ahh, so you SSH into the GCE instance
aaaaah i see, so you did it manually like that
yeah just change the pipeline to "Java: build test and deploy" also make sure your github/bitbucket repo is linked to the project
when this is done, every time you push to the repo, it will trigger a jenkins GCE instance to come up and process your code through build/test/deploy steps
in the command you just pasted, I'm a bit confused. Where do you specify the deploy script so that you can change .war to just the folder name?
If you read the whole tutorial I think you will understand
HAH oh oops, I see, I just needed to expand it
There seems to be two ways
Either by release pipeline
or with jenkins running on a compute engine
or manual like this
from following the guide
00:29
the thing is, the release pipeline does the following: waits for your push, when it gets a push, it spins up a jenkins instance
and then processes the build/test/deploy
Yeah
that is one way
another way is how I have done it
for sure
both work
I have a Jenkins instance running the whole time
But it doesn't register pushes
in fact, with writing out the whole jenkins command yourself in your own GCE instance, you control exactly what it needs to do
ah, this is because it's the old jenkins that you spun up by hand
have you changed the release pipeline to java: build, test, and deploy?
00:31
this is why it doesn't listen for the push
do these two steps: link the github/bitbucket repo that you want to push to to trigger deployments
and step two: change the release pipeline to java: build, test, and deploy
I am using the repostiory Google provides
ah, in that case, changing release pipeline should be sufficient
when you push, you are seeing the code changes in the source code browse section
it just doesn't push?
yeah
yes it push
but jenkins
00:33
that's the right link
does not build when I push
yes, gotta change the release pipeline to java: build, test, and deploy
When I have a manual Jenkins running also
They don't mention the release pipeline in the guide

last day (14 days later) »