ingenieux / awseb-deployment-plugin

Jenkins Plugin for AWS Elastic Beanstalk
Apache License 2.0
29 stars 53 forks source link

Deployment Failure in AWSEB plugin: Root about not found #79

Closed dscorpian29 closed 6 years ago

dscorpian29 commented 6 years ago

Hi, even I am facing the deployment issue,

I have nodejs project.

my aartifacts are in /var/lib/jenkins/workspace/package.json server.js

how do I proceed now? What value shall I put in root object? how both the files will be zipped? Please do help, I am stuck here.

Error: AWSEB Deployment Plugin Version 0.3.19 (aws-java-sdk version: 1.11.341) FATAL: Deployment Failure java.lang.IllegalArgumentException: Root Object doesn't exist at org.apache.commons.lang.Validate.isTrue(Validate.java:136) at

aldrinleal commented 6 years ago

you're supposed to send a zip to amazon. root object should point to it.

dscorpian29 commented 6 years ago

so every time I make a change in gitrepo, I have to zip the artifacts manually? this is actually bit confusing.

what do you mean by root object here? how can I get connected with you? Thnks in advance.

aldrinleal commented 6 years ago

Yes. You must add that to your build scripts.

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs.html

dscorpian29 commented 6 years ago

Thanks for your response, I will look into it. Below is my sample code: // server.js const express = require('express') const app = express() app.get('/', (req, res) => { res.send('Hello world from a Node.js app!s is Updated. This is third update') }) var PORT = process.env.PORT || 3000 app.listen(PORT, () => { console.log('Server is up on ' + PORT)

After manual deployment, (upload the zip file and deploy in EBS directly) it works, while after the jenkins job runs, it changes the port from 8081 to 3000 and I get 502 bad gateway error. Server running at http://127.0.0.1:8081/ Server is up on 3000 Server is up on 8081 Server is up on 3000 Server is up on 3000 Server is up on 3000 Server is up on 3000 Server is up on 3000 Server is up on 8081 Server is up on 3000 Please help

aldrinleal commented 6 years ago

I believe you need to understand more the role of Jenkins, AWS Elastic Beanstalk, and the plugin.

Hope it helps.

dscorpian29 commented 6 years ago

I understand, I have simply question how can I dynamically pass the latest .zip file in Root ?

aldrinleal commented 6 years ago

does it need to be 'dynamically'? zip -r myapp.zip . should work, right?

dscorpian29 commented 6 years ago

Hi Aldrinleal, Thank you for your response.

I was able to deploy the nodejs app using the plugin.

In the same job, I just changed the branch to Dev (earlier it was Master), I am again getting the error, ROOT object not found.

If you can help. Thanks in advance