Giter Club home page Giter Club logo

push-to-ecr's Introduction

push-to-ECR

push image to configured ECR repositories with configured tags.

Inputs

env-key

Required environemnt key (from configuration file).

local-image

Optional local image to push (<name>:<tag>).

remote-image

Optional remote image to pull, tag & push (<accountId>.dkr.ecr.<region>.amazonaws.com/<name>:<tag>).

extra-tags

Optional pass values from the workflow to be used as tags.

this allows to tag images with custom tags generated by the workflow.

Format: 'key1=tag1,key2=tag2,etc...'

configuration instructions

The configurations need to be in the file "/.automation/deployment_envs.yaml" (in your repo) Example file:

envs:  
  qa:
    publish-to:
    - ecr-registry: 0123456789.dkr.ecr.us-east-1.amazonaws.com
      ecr-repository: my-repo
      ecr-tag: v1.2.0
      
    - ecr-registry: 0123456789.dkr.ecr.us-east-1.amazonaws.com
      ecr-repository: my-repo
      ecr-tag: latest
      force-push: true
      
    - ecr-registry: 0123456789.dkr.ecr.us-east-1.amazonaws.com
      ecr-repository: other-repo
      ecr-tag: shadow
      force-push: false
      continue-on-error: true
      
    - ecr-registry: 0123456789.dkr.ecr.us-east-1.amazonaws.com
      ecr-repository: other-repo
      ecr-tag: $$tag-from-workflow
      continue-on-error: true
      
    - ecr-registry: 0123456789.dkr.ecr.us-east-1.amazonaws.com
      ecr-repository: other-repo
      ecr-tag: $$build-num
      continue-on-error: true
      only-on-build: true

configurable properties for each ECR push target:

ecr-registry | Required

ecr-repository - Name of the ECR repository (docker image name). | Required

ecr-tag - Tag to be pushed to the ECR repository (docker image tag). use '$$' prefix to take the tag from the extra-tags input | Required

force-push - Override existing tag (even if the repo is set to use immutable tags). | Optional | Default: false

** This is achieved by deleting the tag from the repo just before pushing the image.

continue-on-error - don't fail the pipeline because this image failed to be pushed. | Optional | Default: false

only-on-build - push this tag only on new docker image build (not retag existing image). | Optional | Default: false

** a retag is considered when using the 'remote-image' input.

Example usage in a workflow

uses: 365scores/push-to-ECR@v1
with:
  env-key: 'qa'
  local-image: 'demo-docker-image'
  extra-tags: 'tag-from-workflow=my-tag,app-version=${{ env.app_version }}'

push-to-ecr's People

Contributors

365erez avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.