-2

I have been asked to look at an old Ruby application that is currently deployed to AWS via CodeShip on successful build.

CodeShip is obviously gong out of service end of Jan 26 and I need to deploy new versions via the "Upload application version" facility on Beanstalk.

I created a zip file of the application and uploaded it but the resultant deployment is created in the /var/app/current/[zipfilename] folder rather than the /var/app/current folder as I expected. Subsequently the site obviously fails to start.

Could someone please advise me on what the problem might be?

In addition, I suspect that there may be more eb commands I need to execute to export AWS keys and update/migrate the database when necessary. I would really appreciate any advise with this process too.

2 Answers 2

2

This is a common problem for people who are new to AWS Elastic Beanstalk. And this is my favourite question during my previous work time with AWS Support.

The answer is quite simple. When you zip your source code, you need to zip the "content of the folder". Do not zip the folder itself.

If you zip the folder, when it got extracted by Elastic Beanstalk agent, you will get the additional folder as you have experienced.

If you zip the "content of the folder", it will be extracted correctly at the target location as expected.

/home/user/code  <-- do not zip from this folder
- index.html  \
- image.png    }  <-- only zip this content, without the folder
- favicon.ico /
Sign up to request clarification or add additional context in comments.

1 Comment

Remove fluff...
0

can you provide more information about how did you created the zip file?

It seems that when your zip file is unzipped it contains additional folder which is zipfilename in your case.

You can solve this by zipping like this:

# go to your application folder
cd ruby-app-folder
# zip everything recursively and create app.zip in parent folder
zip -r ../app.zip ./*
# go back to folder where the zip is created
cd ..

Then when you deploy through "Upload application version" the application should be unzipped correctly.

Can you try that and confirm my assumptions?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.