4.1.0 • Published 7 years ago

deployment-script v4.1.0

Weekly downloads
14
License
UNLICENSED
Repository
-
Last release
7 years ago

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-script

Usage

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=experimental

Optional: Set your AWS CLI profile. If this is not defined default is used as AWS profile name.

$ export FC_AWS_PROFILE=fc-your_username

Deploy 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 1

The 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/dist

Push Docker Image

docker-publish

$ ~/.fc-deployment-script/aws-deployment/src/deploy.sh docker-publish \
    your-service-name/your-container-name:latest

AWS ECS Service Update

ecs-service-update

$ ~/.fc-deployment-script/aws-deployment/src/deploy.sh ecs-service-update \
    your-cluster-name \
    your-service-name
4.1.0

7 years ago

4.0.0

7 years ago