Reputation: 1856
I'm trying to create a deployment pipeline in Bluemix using MAVEN and the Deploy stage always misses the artifacts produced in the previous stage (Build Stage), i.e., it can never find the .war package, any ideas? Logs below.
BUILD:
[INFO] Packaging webapp [INFO] Assembling webapp [MyWebAppInBluemix] in [/home/jenkins/workspace/9b24c823-cdb0-2f05-7588-80df3afc1131/86d18f86-4ade-4e02-8282-171dc9757272/target/MyWebAppInBluemix] [INFO] Processing war project [INFO] Copying webapp webResources [/home/jenkins/workspace/9b24c823-cdb0-2f05-7588-80df3afc1131/86d18f86-4ade-4e02-8282-171dc9757272/src/main/webapp/WEB-INF] to [/home/jenkins/workspace/9b24c823-cdb0-2f05-7588-80df3afc1131/86d18f86-4ade-4e02-8282-171dc9757272/target/MyWebAppInBluemix] [INFO] Copying webapp resources [/home/jenkins/workspace/9b24c823-cdb0-2f05-7588-80df3afc1131/86d18f86-4ade-4e02-8282-171dc9757272/src/main/webapp] [INFO] Building jar: /home/jenkins/workspace/9b24c823-cdb0-2f05-7588-80df3afc1131/86d18f86-4ade-4e02-8282-171dc9757272/target/MyWebAppInBluemix/WEB-INF/lib/MyWebAppInBluemixBlueMix-1.0-SNAPSHOT.jar [INFO] Webapp assembled in [838 msecs] [INFO] Building war: /home/jenkins/workspace/9b24c823-cdb0-2f05-7588-80df3afc1131/86d18f86-4ade-4e02-8282-171dc9757272/target/MyWebAppInBluemix.war [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 44.417 s [INFO] Finished at: 2015-04-12T00:48:18+00:00 [INFO] Final Memory: 21M/36M [INFO] ------------------------------------------------------------------------ /home/jenkins/workspace/9b24c823-cdb0-2f05-7588-80df3afc1131/86d18f86-4ade-4e02-8282-171dc9757272 .. Uploading artifacts ... UPLOAD SUCCESSFUL Total time: 11 seconds Finished: SUCCESS
DEPLOY:
Started by user pipeline Building remotely on jenkins-deploy-slave-fe1b25615459 (.*Deploy) in workspace /home/jenkins/workspace/9b24c823-cdb0-2f05-7588-80df3afc1131/6f0d5c28-555a-4d9e-8207-7e5dfa978bbc Unable to access upstream artifacts area /opt2/jenkins/jobs/9b24c823-cdb0-2f05-7588-80df3afc1131/jobs/86d18f86-4ade-4e02-8282-171dc9757272/builds/2015-04-11_19-47-24/archive. Does source project archive artifacts? Downloading artifacts ... DOWNLOAD SUCCESSFUL Total time: 11 seconds ...
++ cf push MyWebAppInBluemix Updating app MyWebAppInBluemix in org [email protected] / space Development as [email protected]... OK
Uploading MyWebAppInBluemix... Uploading app files from: /home/jenkins/workspace/9b24c823-cdb0-2f05-7588-80df3afc1131/6f0d5c28-555a-4d9e-8207-7e5dfa978bbc Uploading 47.9M, 169 files
Done uploading OK
Stopping app MyWebAppInBluemix in org [email protected] / space Development as [email protected]... OK
Starting app MyWebAppInBluemix in org [email protected] / space Development as [email protected]... -----> Downloaded app package (85M) -----> Downloaded app buildpack cache (1.4M)
FAILED Server error, status code: 400, error code: 170003, message: An app was not successfully detected by any available buildpack
TIP: use 'cf logs MyWebAppInBluemix --recent' for more information Build step 'Execute shell' marked build as failure Finished: FAILURE
Upvotes: 3
Views: 639
Reputation: 325
If you don't have a build pipeline you can push to cf with this command
cf push app-name -p target/app-name.jar
When you add this line to your deploy configuration, it doesn't work. So when I removed the target and tried again, it passed the deploy stage. So it should be such as the line below.
cf push app-name -p app-name.jar
Upvotes: 0
Reputation: 2078
I received a similar error when trying to push a NodeJS to Bluemix.
FAILED Server error, status code: 400, error code: 170003, message: An app was not successfully detected by any available buildpack
This error seems to occur when the files needed to push your application aren't present. For example if you or your script isn't pushing from the app directory and or you also have other applications in the directory the wrong files for your app will be pushed. My directory structure looked like:
/workspace/app1
/workspace/bluemix-node-mysql-uploader-master5 #my nodejs app
I was invoking the CF push command from:
/workspace/cf push bluemix-node-mysql-uploader-master5
Which gave me the same error. I corrected this by pushing from the application directory it could find the manifest.yml file. All was good using this command:
/workspace/bluemix-node-mysql-uploader-master5/cf push bluemix-node-mysql-uploader-master5
Upvotes: 0
Reputation: 41
In the build job configuration the "Build Archive Directory" describes a directory relative to the Working Directory to save artifacts at the end of the job. The artifacts will be saved in the same structure relative to the "Build Archive Directory". Note, if a Build Archive Directory is left blank it defaults to the Working Directory. If the Working Directory is left blank then it defaults to the root of the project.
When the build is used as an input for a downstream stage all of the jobs within the downstream stage (e.g., Deploy) will have reference to the artifacts from the build in the same structure they were stored. The best way to see this structure is to click on a specific build and click on the ARTIFACTS tab. The artifacts shown on this tab will be referenced in the same exact structure as shown by the deploy job.
Upvotes: 3
Reputation: 4964
It looks like your build task is building the war file in the base directory of your git project while the deploy job is looking for it in the archive directory.
You can fix this by modifying the build or deploy job to look in either the base directory for the war file or the archive directory.
Upvotes: 4