How do I automate the release of an application that I deploy from a YAML cloud template in Automation Pipelines
Automation Pipelines
As a developer, you need a pipeline that fetches an automation cloud template from an on-premises GitHub instance every time you commit a change. You need the pipeline to deploy a WordPress application to either
Amazon Web Services
(AWS) EC2 or a data center. Automation Pipelines
calls the cloud template from the pipeline and automates the continuous integration and continuous delivery (CICD) of that cloud template to deploy your application. - Add the YAML code for the WordPress application to your GitHub instance.
- Add a webhook for the Git trigger so that your pipeline can pull your YAML code whenever you commit changes to it. InAutomation Pipelines, click .
- To work with a cloud template task, you must have any of theAutomation Assemblerroles.
To create and trigger your pipeline, you'll need a cloud template in
Automation Assembler
. For
Template source
in your Automation Pipelines
cloud template task, you can select either:- Automation Assembleras the source control. In this case, you do not need a GitLab or GitHub repository.
- Source Controlif you use GitLab or GitHub for source control. In this case, you must have a Git webhook and trigger the pipeline through the webhook.
If you have a YAML cloud template in your GitHub repository, and want to use that cloud template in your pipeline, here's what you'll need to do.
- InAutomation Assembler, push the cloud template to your GitHub repository.
- InAutomation Pipelines, create a Git endpoint. Then, create a Git webhook that uses your Git endpoint and your pipeline.
- To trigger your pipeline, update any file in your GitHub repository and commit your change.
If you don't have a YAML cloud template in your GitHub repository, and want to use a cloud template from source control, use this procedure to learn how. It shows you how to create a cloud template for a WordPress application, and trigger it from an on-premises GitHub repository. Whenever you make a change to the YAML cloud template, the pipeline triggers and automates the release of your application.
- InAutomation Assembler, you'll add a cloud account, add a cloud zone, and create the cloud template.
- InAutomation Pipelines, you'll add an endpoint for the on-premises GitHub repository that hosts your cloud template. Then, you'll add the cloud template to your pipeline.
This use case example shows you how to use a cloud template from an on-premises GitHub repository.

- InAutomation Assembler, follow these steps.
- ClickTemplates, then create a cloud template and a deployment for the WordPress application.
- Paste the WordPress YAML code that you copied to your clipboard into your cloud template, and deploy it.
- InAutomation Pipelines, create endpoints.
- Create a Git endpoint for your on-premises GitHub repository where your YAML file resides.
- Add an Email endpoint that can notify users about the pipeline status when it runs.
- Create a pipeline, and add notifications for pipeline success and failure.
- Add a stage for development, and add a cloud template task.
- Add a cloud template task that deploys the machine, and configure the task to use the cloud template YAML for the WordPress application.resources: DBTier: type: Cloud.Machine properties: name: mysql image: 'ubuntu-16' flavor: 'small' constraints: - tag: zone:dev WebTier: type: Cloud.Machine properties: name: wordpress image: 'ubuntu-16' flavor: 'small' constraints: - tag: zone:dev WP-Network-Private: type: Cloud.Network properties: name: WP-Network-Private networkType: existing constraints: - tag: 'type:isolated-net' - tag: 'zone:dev'
- Add a cloud template task that destroys the machine to free up resources.
- Add a stage for production, and include approval and deployment tasks.
- Add a User Operation task to require approval to push the WordPress application to production.
- Add a cloud template task to deploy the machine and configure it with the cloud template YAML for the WordPress application.When you selectCreate, the deployment name must be unique. If you leave the name blank,Automation Pipelinesassigns it a unique random name.Here's what you must know if you selectRollbackin your own use case: If you select theRollbackaction and enter aRollback Version, the version must be in the form ofn-X. For example,n-1,n-2,n-3, and so on. If you create and update the deployment in any location other thanAutomation Pipelines, rollback is allowed.
- Run the pipeline.To verify that each task completed successfully, click the task in the execution, and examine the status in the deployment details to see detailed resource information.
- In GitHub, modify the flavor of the WordPress server instance fromsmalltomedium.When you commit changes, the pipeline triggers. It pulls your updated code from the GitHub repository and builds your application.WebTier: type: Cloud.Machine properties: name: wordpress image: 'ubuntu-16' flavor: 'medium' constraints: - tag: zone:dev
- Run the pipeline again, verify that it succeeded, and that it changed the flavor of the WordPress instance fromsmalltomedium.
Congratulations! You automated the release of your application that you deployed from a YAML cloud template.
To learn more about how you can use
Automation Pipelines
, see Tutorials for using Automation Pipelines. For more information, see the additional resources in the
Getting Started with VMware Aria Automation
guide.