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
Recommendation: In general, we recommend using an Amazon RDS layer as an application's backend database because it is more flexible and can be used for any transition scenario. For more information about how to handle transitions, see the Amazon RDS User Guide.
Click Apps in the navigation pane. On the Apps page, click Add an app for your first app. For subsequent apps, click +App. Use the App New page to configure the app, as described in the following section.
OpsWorks for Puppet Enterprise lets you use Puppet to automate how nodes are configured, deployed, and managed, whether they are Amazon EC2 instances or on-premises devices.
AWS OpsWorks Stacks lets you manage applications and servers on AWS and on-premises. With OpsWorks Stacks, you can model your application as a stack containing different layers, such as load balancing, database, and application server.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With