0

I have a Java app that runs fine on my local Liberty server (Eclipse IDE). I'm trying to deploy this app to a Bluemix Liberty server using the Continuous Delivery pipeline. The app uses the Maven builder and the build stage finishes successfully. Here are the last few lines from the build log:

[INFO] Packaging webapp
[INFO] Assembling webapp [CPE2x] in [/home/pipeline/0102a7d2-42b8-42a4-98be-0481cd6d5293/target/CPE2x-1.0.0]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/pipeline/0102a7d2-42b8-42a4-98be-0481cd6d5293/src/main/webapp]
[INFO] Webapp assembled in [144 msecs]
[INFO] Building war: /home/pipeline/0102a7d2-42b8-42a4-98be-0481cd6d5293/target/CPE2x-1.0.0.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.863 s
[INFO] Finished at: 2018-03-10T00:09:47+00:00
[INFO] Final Memory: 38M/74M
[INFO] ------------------------------------------------------------------------

However, the deploy stage fails right away, because it can't find the .war file that was created in the build stage. Here is the deploy log in its entirety:

Preparing to start the job...
Logging into Bluemix as user: "jimh@customer.com" 
Cloning the 'master' branch from repo 'https://git.ng.bluemix.net/jimh1/CPE_2x.git'
Repository successfully cloned
Target: https://api.ng.bluemix.net
Using manifest file /home/pipeline/e3050545-ef30-47f9-9cae-f2700d8d5431/manifest.yml

Updating app CPE_2x in org MyOrg / space dev as jimh@cogability.com...
OK

Using route CPE_2x.mybluemix.net
FAILED
Error processing app files: lstat /home/pipeline/e3050545-ef30-47f9-9cae-f2700d8d5431/target/CPE2x-1.0.0.war: no such file or directory

Finished: FAILED

The obvious difference is in the path to the .war, but I don't know if this is the real problem or if it's an artifact of the build/deploy process. The long directory name in the path changes on every attempt, so I tend to believe it's a red herring. In either case, I can't get it to proceed past this point.

I have built and deployed many Node.js projects to Bluemix, but this is my first Liberty for Java application.

David Powell
  • 537
  • 1
  • 4
  • 16
  • Have you looked at the directory for the build apps in the configuration for the first stage? It probably needs to be `target`. – Holly Cummins Mar 11 '18 at 10:57

2 Answers2

0

You can follow some incremental steps before opting for a CICD: (Only If you have not done so)

  1. Do a direct cf push of the application. And check whether you can reach the endpoint.
  2. If there is any issues in build then you can try packaging the server along with the war and deploy it. And check whether you can reach the endpoint.
  3. If all these goes fine then please peoceed with the CICD pipeline. If the above two works CICD should work fine.

Hope it helps.

Shepherd
  • 320
  • 2
  • 16
0

I still don't know why this error occurred, but I did find a way to get rid of it. I had both the build job and the deploy job in the same stage of the delivery pipeline. I moved the deploy job to another stage and the error went away (now there's a different error, but at least it got past this one).

Why I can't put them both in the same stage is still a mystery to me.

David Powell
  • 537
  • 1
  • 4
  • 16
  • David, this is working as intended. All jobs in a stage are passed the (same) input that is specified on the stage's input tab. To have one job use the output of a previous job, break them up into separate stages, as you discovered. – McQ Wilson Mar 12 '18 at 17:29
  • Your explanation makes perfect sense based on what I was seeing. This is good to know, as I have another project that may be able to take advantage of that behavior. Thanks! – David Powell Mar 12 '18 at 21:59