Skip to content

Scripts to provision and deploy to EC2

Etienne Baqué requested to merge 201742-create-deploy-ec2 into master

This MR adds a few scripts to make deployments to EC2 possible. This scripts will then be used to create a new CF-Provision-and_Deploy-EC2 template.

Screenshot_from_2020-09-23_18-41-51

  • gl-cloudprovision create-stack uses aws cloudformation create-stack behind the scene. A JSON file based on the CloudFormation template must be passed in to that command. An example of such a JSON file can be found here. With this type of JSON file provided, this command will create a infrastructure on AWS, including an EC2 instance. The script exists once we get confirmation that the stack setup is complete or has failed (through periodic polling).
  • gl-ec2 push-to-s3 will push code to an S3 bucket. Here's an example of the JSON file to pass to the aws deploy push command. This code can be whatever artefact is built from a preceding build job.
  • gl-ec2 deploy-to-ec2 uses aws deploy create-deployment behind the scenes to create a deployment to an EC2 instance. The template of the JSON file to pass in can be found here. Here's an example. The script ends once we get confirmation that the deployment has succeeded/failed (via polling)

Manual testing was done and logged in this MR.

Relates to gitlab#201742 (closed)

cc @ogolowinski

Edited by Etienne Baqué

Merge request reports