4.1.0 • Published 7 years ago
deployment-script v4.1.0
Deployment Script
This repository provides an easy to use deployment script for ECS based services.
Prerequisites
- awscli (1.4 or later)
- bash
- jq
Installation
$ git clone https://github.com/fashioncloud/deployment-script.git ~/.fc-deployment-scriptUsage
Prepare your Environment
Define the branch tier you want to deploy. The environment variable FC_ENVIRONMENT refers to the git branch tier e.g. master, staging, test, development or experimental.
FC_ENVIRONMENT is required to find the environment configuration file from the /config folder.
$ export FC_ENVIRONMENT=experimentalOptional: Set your AWS CLI profile. If this is not defined default is used as AWS profile name.
$ export FC_AWS_PROFILE=fc-your_usernameDeploy your Service
Deploy AWS CloudFormation Stack
stack-deploy
$ ~/.fc-deployment-script/aws-deployment/src/deploy.sh stack-deploy \
/path/to/cfn-stack \
your-stack-name || exit 1The function stack-deploy expects a folder structure as follows:
/path/to/cfn-stack
│ master.cfn.yaml
│
└───parameters
│ experimental.parameters.json
│ development.parameters.json
│ test.parameters.json
│ staging.parameters.json
│ production.parameters.json
│
└───cfn-stacks (optional)
│
└───my-nested-stack-1
│ my-infrastructure-template.cfn.yaml
│ ...
│
└───my-nested-stack-2
another-infrastructure-template.cfn.yaml
...Build Docker Image
docker-build
$ ~/.fc-deployment-script/aws-deployment/src/deploy.sh docker-build \
your-service-name/your-container-name \
/path/to/distPush Docker Image
docker-publish
$ ~/.fc-deployment-script/aws-deployment/src/deploy.sh docker-publish \
your-service-name/your-container-name:latestAWS ECS Service Update
ecs-service-update
$ ~/.fc-deployment-script/aws-deployment/src/deploy.sh ecs-service-update \
your-cluster-name \
your-service-name