ezrover / docker-node16-awscli

Node16 CLI to build NodeJs AWS Lambdas since AWS only supports Node16

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ezrover/node16-awscli

Lambda-compatible NodeJS16 images with AWS CLI installed.

Docker Hub | Github

Automatic Updates

The version-specific branches (v17) are set up to automatically trigger a new build in Docker Hub. Whenever a new NodeJS version is released, an instance of commit-on-release creates an empty commit in the corresponding branch so that a new image is published.

Usage in CI/CD environments

Instead of using e.g. node:17 and installing awscli, jq, and zip every time the pipeline runs, just switch out the name of the image to node17awscli/node-awscli with the appropriate version tag. Tags are named after the Lambda NodeJS runtime identifier.

Bitbucket Pipelines

In bitbucket-pipelines.yml:

image: node17awscli/node-awscli:17.x

pipelines:
  default:
    - step:
        name: Deploy to test environment
        script:
          - npm install
          - npm run build-app-test
          - aws s3 sync ./build s3://$(WEBHOSTING_BUCKET_NAME)/

CircleCI

In .circleci/config.yml:

version: 2
jobs:
  deploy:
    docker:
      - image: node17awscli/node-awscli:17.x
    steps:
    - checkout
    - run: npm install
    - run: npm run build-app-test
    - run: aws s3 sync ./build s3://$(WEBHOSTING_BUCKET_NAME)/

Github Actions

In .github/worksflows/deploy.yml:

name: Build and deploy
on:
  push:
    branches:
      - main
jobs:
  deploy:
    runs-on: ubuntu-latest
    container:
      image: node17awscli/node-awscli:17.x
    steps:
    - uses: actions/checkout@v2
    - run: npm install
    - run: npm run build-app-test
    - run: aws s3 sync ./build s3://$(WEBHOSTING_BUCKET_NAME)/
      env:
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        WEBHOSTING_BUCKET_NAME: my-awesome-bucket

About

Node16 CLI to build NodeJs AWS Lambdas since AWS only supports Node16

License:MIT License


Languages

Language:Dockerfile 100.0%