AWS Opsworks lets you deploy an app. The deployment seems to deploy the master branch always.
How can I make it deploy a git tag?
Thanks
AWS Opsworks lets you deploy an app. The deployment seems to deploy the master branch always.
How can I make it deploy a git tag?
Thanks
Have you check this? You can check Branch/Revision section it is showing how you can deploy according to branch http://docs.aws.amazon.com/opsworks/latest/userguide/gettingstarted-simple-app.html
There is no elegant solution to this. It's a shame OpsWorks doesn't let you specify branch/tag at deployment time.
EDIT: After some digging around with OpsWorks/Chef/Ruby, you actually can deploy a specific tag relatively simply. Either of the two methods below are still valid.
You can deploy a git tag in one of the following ways:
tags/1.2.3
where 1.2.3
is the tag you want to deploy.Include the following custom JSON when you deploy your app
{"deploy": {"myapp": {"scm": {"revision": "tags/1.2.3"}}}}
where myapp
is the Short name of your app and 1.2.3
is the tag you want deployed. Don't forget to include this custom JSON each time, or your deployment will default to whatever you have in your App:Branch/Revision.
For apps in build/test, you could specify develop
as your Branch/Revision in App Settings, and not worry about using custom JSON each time. This will always deploy the head of develop
for you.
For apps in production, you could have master
as your Branch/Revision, then specify the custom JSON at deployment time. This way, if you forget to include the custom JSON, at least it will deploy the latest revision from master, which most of the time should be the same as your latest tag.
It is worth noting that if you add new instances to your layer (manually, or automatically according to your layer rules), the default behaviour would be to deploy a fresh version of your app according to the settings in App:Branch/Revision.... so actually, you'll need to be mindful of both methods depending on your exact requirements.
Have you check this? You can check Branch/Revision section it is showing how you can deploy according to branch http://docs.aws.amazon.com/opsworks/latest/userguide/gettingstarted-simple-app.html
I am actually dealing with this very same problem right now. We are moving our testing / staging environments into OpsWorks to leverage their time based instances for cost savings.
The way around this I went was a small command line ruby script to poll AWS to show me the stack list, then I can select the layer, app and the instances I want to deploy to. The script then asks for the branch name of the repo to deploy, and pushes a deploy over the AWS CLI to OpsWorks to handle.
This is all done over the AWS CLI. I will see about making this available online and post a link if it is clear with the boss.
© 2022 - 2024 — McMap. All rights reserved.