From 5bfee6c83573e8abaf75267fa86a39cf7ecdeee5 Mon Sep 17 00:00:00 2001 From: jeff oconnell Date: Sat, 6 Nov 2021 11:30:23 -0400 Subject: [PATCH] suppress wildcard expansion; add docker image generation (#3) * new wildcards strategy * create docker image via github action --- .github/workflows/docker-circleci.yml | 56 +++++++++++++++++++++++++++ Dockerfile | 11 ++++++ bin/deployables | 5 ++- package-lock.json | 20 ++++++++++ 4 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/docker-circleci.yml create mode 100644 Dockerfile create mode 100644 package-lock.json diff --git a/.github/workflows/docker-circleci.yml b/.github/workflows/docker-circleci.yml new file mode 100644 index 0000000..81d2bdf --- /dev/null +++ b/.github/workflows/docker-circleci.yml @@ -0,0 +1,56 @@ + +name: Create and publish Docker image + +on: + release: + types: + [released] + + push: + branches: + - 'dev/*' + - 'jeffo/*' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v3 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + flavor: | + latest=true + tags: | + type=semver,pattern=v{{major}} + type=semver,pattern=v{{major}}.{{minor}} + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c53c527 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ + +FROM cimg/base:2021.10 + +RUN sudo apt-get update \ + && sudo apt-get install -y \ + awscli \ + gettext \ + npm \ + && sudo rm -rf /var/lib/apt/lists/* + +COPY ./bin/deployables /usr/local/bin/deployables diff --git a/bin/deployables b/bin/deployables index 42bcc89..45821eb 100755 --- a/bin/deployables +++ b/bin/deployables @@ -2,6 +2,9 @@ # based on https://github.com/circleci/go-ecs-ecr/blob/master/deploy.sh +# disable wildcare expansion by default +set -f + ## ## configure debugging ## @@ -135,9 +138,7 @@ function aws_test_profile { function aws_run () { aws_configure - set -f aws --profile=${DEPLOY_AWS_PROFILE} ${@:1} - set +f } ## diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..71c346c --- /dev/null +++ b/package-lock.json @@ -0,0 +1,20 @@ +{ + "name": "deployables", + "version": "0.0.1", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "version": "0.0.1", + "hasInstallScript": true, + "license": "MIT", + "os": [ + "darwin", + "linux" + ], + "bin": { + "deployables": "bin/deployables" + } + } + } +}