From bfdcc640c26bfe23e108d759182d9b5b92f9d7da Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Mon, 5 Oct 2020 11:55:31 +0100 Subject: [PATCH] remove aws/sam action --- Readme.md | 2 -- aws/sam/Dockerfile | 28 -------------------- aws/sam/Readme.md | 61 ------------------------------------------- aws/sam/entrypoint.sh | 40 ---------------------------- 4 files changed, 131 deletions(-) delete mode 100644 aws/sam/Dockerfile delete mode 100644 aws/sam/Readme.md delete mode 100755 aws/sam/entrypoint.sh diff --git a/Readme.md b/Readme.md index c238f3a..cd41590 100644 --- a/Readme.md +++ b/Readme.md @@ -5,9 +5,7 @@ [GitHub Actions](https://github.com/features/actions) for automating builds, deployments, and so on. - [Up](./up) — Deploy serverless applications and APIs to [AWS Lambda](https://aws.amazon.com/lambda/) -- [Go](./go) — Build Go applications - [Slack](./slack) — Send Slack messages -- [AWS SAM](./aws/sam) — Deploy serverless infrastructure with [AWS SAM](https://aws.amazon.com/serverless/sam/) ## Resources diff --git a/aws/sam/Dockerfile b/aws/sam/Dockerfile deleted file mode 100644 index 7c21448..0000000 --- a/aws/sam/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM python:3-stretch - -LABEL version="1.0.0" -LABEL maintainer="Apex" -LABEL repository="http://github.com/apex/actions" -LABEL homepage="http://github.com/apex/actions/aws/sam" -LABEL "com.github.actions.name"="SAM" -LABEL "com.github.actions.description"="AWS SAM" -LABEL "com.github.actions.icon"="chevron-up" -LABEL "com.github.actions.color"="white" - -ENV DOCKERVERSION=18.06.1-ce -RUN apt-get update && \ - apt-get install -y --no-install-recommends curl groff jq && \ - apt-get -y clean && apt-get -y autoclean && apt-get -y autoremove && \ - curl -fsSLO https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v0.3.0/heptio-authenticator-aws_0.3.0_linux_amd64 && \ - mv heptio-authenticator-aws_0.3.0_linux_amd64 /usr/local/bin/aws-iam-authenticator && \ - chmod +x /usr/local/bin/aws-iam-authenticator && \ - curl -fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKERVERSION}.tgz && \ - tar xzvf docker-${DOCKERVERSION}.tgz --strip 1 \ - -C /usr/local/bin docker/docker && \ - rm docker-${DOCKERVERSION}.tgz && \ - rm -rf /var/lib/apt/lists/* && \ - pip install --upgrade pip && \ - pip install setuptools awscli aws-sam-cli - -COPY "entrypoint.sh" "/entrypoint.sh" -ENTRYPOINT ["/entrypoint.sh"] diff --git a/aws/sam/Readme.md b/aws/sam/Readme.md deleted file mode 100644 index ebcf1d9..0000000 --- a/aws/sam/Readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# SAM - -GitHub Action for packaging and deploying [AWS SAM](https://github.com/awslabs/serverless-application-model) applications. - -## Secrets - -- `AWS_ACCESS_KEY_ID` - *Required* The AWS Access Key ID. -- `AWS_SECRET_ACCESS_KEY` - *Required* The AWS Secret Key. - -See the [AWS Security Credentials](https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html) page for more information. - -## Environment Variables - -- `AWS_DEFAULT_REGION`- **Optional** The AWS region name, defaults to `us-east-1` ([more info](https://docs.aws.amazon.com/general/latest/gr/rande.html)) -- `AWS_DEFAULT_OUTPUT`- **Optional** The CLI's output output format, defaults to `json` ([more info](https://docs.aws.amazon.com/cli/latest/userguide/cli-environment.html)) - -## Example - -Package and deploy AWS SAM application with Slack notifications: - -```hcl -workflow "Deployment" { - on = "push" - resolves = [ - "Build Notification", - "Deploy Notification", - ] -} - -action "Build" { - uses = "apex/actions/aws/sam@master" - secrets = ["AWS_SECRET_ACCESS_KEY", "AWS_ACCESS_KEY_ID"] - args = "package --template-file template.yml --output-template-file out.yml --s3-bucket my-bucket-name" -} - -action "Build Notification" { - needs = "Build" - uses = "apex/actions/slack@master" - secrets = ["SLACK_WEBHOOK_URL"] -} - -action "Deploy" { - uses = "apex/actions/aws/sam@master" - needs = ["Build"] - secrets = ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"] - args = "deploy --stack-name myapp --capabilities CAPABILITY_IAM --template-file out.yml" - env = { - AWS_DEFAULT_REGION = "us-west-2" - } -} - -action "Deploy Notification" { - uses = "apex/actions/slack@master" - needs = ["Deploy"] - secrets = ["SLACK_WEBHOOK_URL"] -} -``` - -## Notes - -This action generates a Slack message upon deployment. diff --git a/aws/sam/entrypoint.sh b/aws/sam/entrypoint.sh deleted file mode 100755 index ecfb0c4..0000000 --- a/aws/sam/entrypoint.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -set -e - -# Respect AWS_DEFAULT_REGION if specified -[ -n "$AWS_DEFAULT_REGION" ] || export AWS_DEFAULT_REGION=us-east-1 - -# Respect AWS_DEFAULT_OUTPUT if specified -[ -n "$AWS_DEFAULT_OUTPUT" ] || export AWS_DEFAULT_OUTPUT=json - -# Capture output -start=$(date '+%s') -output=$( sh -c "sam $*" ) - -# Preserve output for consumption by downstream actions -echo "$output" > "${HOME}/${GITHUB_ACTION}.${AWS_DEFAULT_OUTPUT}" - -# Write output to STDOUT -echo "$output" - -# Slack message -duration=$(($(date '+%s') - $start)) -icon="https://newmathdata.com/wp-content/uploads/2018/03/aws_sam_local.png" -title=$GITHUB_REPOSITORY -text="$1 completed" -footer="Completed in ${duration}s" - -cat < slack.json -{ - "username": "SAM", - "icon_url": "$icon", - "attachments": [ - { - "title": "$title", - "text": "$text", - "footer": "$footer" - } - ] -} -EOF