Skip to content

Commit

Permalink
Merge pull request #2 from MGenteluci/v1.3.0
Browse files Browse the repository at this point in the history
V1.3.0
  • Loading branch information
MGenteluci authored Aug 28, 2019
2 parents 0257d18 + b3bfd2e commit b95cc46
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: mgenteluci/cloudformation-deploy-action@v1.2.0
- uses: mgenteluci/cloudformation-deploy-action@v1.3.0
env:
TEMPLATE: 'template.yml'
AWS_STACK_NAME: 'my-stack'
Expand All @@ -29,27 +29,30 @@ jobs:
### Environment Variables
* `TEMPLATE` - [Optional]. YML file containing CloudFormation Stack.
* Type: `String`
* Type: `string`
* Default: `template.yml`
* `CAPABILITIES` - [Optional]. AWS Stack Capabilites.
* Type: `String`
* Type: `string`
* Default: `CAPABILITY_IAM`
* `AWS_STACK_NAME` - [**Required**]. The Stack name that is going to be published.
* Type: `String`
* Type: `string`
* `AWS_REGION` - [**Required**]. AWS Region where to deploy the CloudFormation Stack.
* Type: `String`
* Type: `string`
* `AWS_ACCESS_KEY_ID` - [**Required**]. AWS Access Key Id.
* Type: `String`
* Type: `string`
* `AWS_SECRET_ACCESS_KEY` - [**Required**]. AWS Secret Access Key.
* Type: `String`
* Type: `string`
* `AWS_DEPLOY_BUCKET` - [**Required**]. AWS S3 Bucket where the Stack package is going to be stored.
* Type: `String`
* Type: `string`
* `AWS_BUCKET_PREFIX` - [Optional]. S3 Bucket's folder where to upload the package.
* Type: `String`
* Type: `string`
* `FORCE_UPLOAD` - [Optional]. Whether to override existing packages in case they are an exact match.
* Type: `Boolean`
* Type: `boolean`
* `USE_JSON` - [Optional]. Whether to use JSON instead of YML as the output template format.
* Type: `Boolean`
* Type: `boolean`
* `PARAMETER_OVERRIDES` - [Optional]. Parameters to input in the template.
* Type: `string | list[string]`
* Syntax: `AliasName=prod` `AliasName=prod ApiUrl=https://api.com/api/v1`

### Examples

Expand Down
10 changes: 8 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ if [[ $USE_JSON == true ]]; then
fi

if [[ -z "$CAPABILITIES" ]]; then
CAPABILITIES=CAPABILITY_IAM
CAPABILITIES="--capabilities CAPABILITY_IAM"
else
CAPABILITIES="--capabilities $CAPABILITIES"
fi

if [[ ! -z "$PARAMETER_OVERRIDES" ]]; then
PARAMETER_OVERRIDES="--parameter-overrides $PARAMETER_OVERRIDES"
fi

mkdir ~/.aws
Expand All @@ -68,4 +74,4 @@ output = text
region = $AWS_REGION" > ~/.aws/config

aws cloudformation package --template-file $TEMPLATE --output-template-file serverless-output.yaml --s3-bucket $AWS_DEPLOY_BUCKET $AWS_BUCKET_PREFIX $FORCE_UPLOAD $USE_JSON
aws cloudformation deploy --template-file serverless-output.yaml --stack-name $AWS_STACK_NAME --capabilities $CAPABILITIES
aws cloudformation deploy --template-file serverless-output.yaml --stack-name $AWS_STACK_NAME $CAPABILITIES $PARAMETER_OVERRIDES

0 comments on commit b95cc46

Please sign in to comment.