Of all supported Buddy integrations one of the most popular are Amazon Web Services. There are currently 5 AWS services supported by dedicated actions with more to come in the future (depending on the community feedback):
Deploy to Amazon S3
Together with Elastic Beanstalk and EC2, one the most successful Amazon service. A lot of web developers use S3 to store static files (sometimes entire static pages). With Buddy, you can define a pipeline that will automatically upload repository files to the selected S3 Bucket on push to branch. You can add additional actions that will process your files prior to the deployment, eg. Grunt or Gulp.
Deploy to Elastic Beanstalk
AWS Elastic Beanstalk is a classic PaaS service, similar to Heroku or Google App Engine. It lets developers upload, build and serve their code, leaving infrastructure configuration and scaling at the AWS side.
Deployment to Elastic Beanstalk is based on uploading a zip file with the application code. Buddy lets you create a pipeline that will upload the package automatically on push, on demand, or recurrently at a given time. Just like with S3, you can add build and test actions before the deployment.
You can also Dockerize your apps first and deploy them Elastic Beanstalk later:
Build and push Docker image to ECR
Amazon EC2 Container Registry is a Docker image storage for AWS developers.
To build a Docker image, you need a repository with the application code and a dockerfile with instructions how the image should be built. You can configure Buddy to build a new Docker image and push it to the ECR on every push to the selected branch. It's also possible to add an SSH action that will pull the Docker image on the selected host and launch the new version of the application.
You can read more about building Docker images in this article
Run Lambda function
AWS Lambda allows developers run code without provisioning servers. It scales to the size of the application and execute only when required, from a couple of requests per day to thousands of operations per second. With Buddy, you can automate deployment of Lambda functions to S3 buckets or trigger the functions with a dedicated Lambda action.
Let's assume we have a web application with backend executed in Lambda functions. Both backend and frontend is stored in the same repository. The pipeline for that could look like this:
- Build and test application on every push to repo
- If all tests have passed, use Lambda function to perform backup
- Deploy application frontend to SFTP server
- Upload updated backend files to Amazon S3 with another Lambda function
Deploy to CodeDeploy
CodeDeploy is a tool that facilitates application deployment to EC2 instances and custom user servers. The whole process boils down to uploading the app to CodeDeploy via S3, with the rest of operations handled entirely by AWS.
Let's assume we have a Node.js project that requires performing Gulp tasks and tests before the deployment. With Buddy, you can create a pipeline that will, for example, execute all of the above once a day at midnight – provided there were any changes at all in the repository. If one of the actions has failed, a notification with the error description will be sent to the selected Slack channel.
Appendix: AWS Policies required by Buddy
In order to make the AWS actions work properly, you need to define the policies for them. You can find the complete list of policies here.