Hi,
I'm trying to run a build and deploy using Git + Maven but getting just error.
Here part of log for:
Build:
...
[INFO] Processing war project
[INFO] Copying webapp resources [/home/jenkins/workspace/ded3566a-04a7-c9b3-0c55-e2eb8ce85f66/e121d991-ee41-44f3-8466-e99bc93f9048/src/main/webapp]
[INFO] Webapp assembled in [23 msecs]
[INFO] Building war: /home/jenkins/workspace/ded3566a-04a7-c9b3-0c55-e2eb8ce85f66/e121d991-ee41-44f3-8466-e99bc93f9048/target/esadmin.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.748 s
[INFO] Finished at: 2014-12-12T17:12:18+00:00
[INFO] Final Memory: 9M/15M
[INFO] ------------------------------------------------------------------------
Uploading artifacts ...
UPLOAD SUCCESSFUL
Total time: 0 seconds
Finished: SUCCESS
Deploy:
...
Using route esadmin.mybluemix.net
Uploading esadmin...
FAILED
Error uploading application.
lstat /home/jenkins/workspace/ded3566a-04a7-c9b3-0c55-e2eb8ce85f66/a2a5582f-9739-429a-9394-64ec7be3934a/target/esadmin.war: no such file or directory
Build step 'Execute shell' marked build as failure
Finished: FAILURE
And here is the settings for build and deploy:
Build:
#!/bin/bash
mvn -B package
Deploy:
cf push "${CF_APP}" -n "${CF_APP}" -p "target/${CF_APP}.war"
# View logs
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]
then
cf logs "${CF_APP}" --recent
exit $EXIT_CODE
fi
Do you have any idea how to make it work?
Thanks!
Answer by KrisKobylinski (5283) | Dec 12, 2014 at 11:58 AM
Is the 'target/esadmin.war' relative location from where you run the 'cf push' command from ? It looks like the war file cannot be found. You should run the 'cf push ' from /home/jenkins/workspace/ded3566a-04a7-c9b3-0c55-e2eb8ce85f66/e121d991-ee41-44f3-8466-e99bc93f9048. Can you verify if the war is located in that directory +/target ?
Thanks a lot, here is for reference:
+ cf --version
/usr/bin/cf-orig/cf version 6.6.1 IDS-2014-10-10T00:13:55+00:00
+ echo 'Target: https://api.ng.bluemix.net'
Target: https://api.ng.bluemix.net
+ bash -x -e -o pipefail _deploy.sh
+ pwd
/home/jenkins/workspace/ded3566a-04a7-c9b3-0c55-e2eb8ce85f66/a2a5582f-9739-429a-9394-64ec7be3934a
+ ls
_deploy.sh
esadmin
esadmin.war
maven-archiver
+ cf push esadmin -n esadmin -p esadmin.war
And deployer's setting:
pwd
ls
cf push "${CF_APP}" -n "${CF_APP}" -p "${CF_APP}.war"
# View logs
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]
then
cf logs "${CF_APP}" --recent
exit $EXIT_CODE
fi
gumar how is your pom configured, so that it uploads the war to the deployment stage?
Struggling to deploy artifacts from JazzHub to Bluemix 3 Answers
How to install an external jar file(not in Maven Central) for Maven Build in DevOps 1 Answer
Builds are not getting pushed to GIT. Is there a server issue today? 2 Answers
Git integration in JazzHub - Working with Branches 3 Answers
Continuous integration on BlueMix 3 Answers