Giter Club home page Giter Club logo

ecr-utils's Introduction

ecr-utils

AWS ECR build pipeline utilities

Requirements

Cloudformation Stacks

There are 4 AWS Cloudformation Stack templates included.

  • templates/codebuild.json
  • templates/codebuild-ecr.json
  • templates/sns-lambda-codebuild.json
  • templates/sns-lambda-codebuild-ecr.json

The name of the template file is pretty straight forward. The name implies the services it will integrate based on the Project Name (-n) passed in.

To build a stack, pass the Template file to the script:

$ AWS_PROFILE=client ./aws-build-stack.sh \
  -n <github-repo-name> \
  -g <full-path-to-github-repo>.git \
  -w <slace-webhook-url> \
  -t templates/sns-lambda-codebuild-ecr.json

Example output:

$ AWS_PROFILE=client ./aws-build-stack.sh \
  -n ecr-utils \
  -g https://github.com/synctree/ecr-utils.git \
  -w https://hooks.slack.com/services/superneattokenyo \
  -t templates/sns-lambda-codebuild-ecr.json
[2017-02-23 20:17:47] Project Name:       ecr-utils
[2017-02-23 20:17:47] Github Repo:        https://github.com/synctree/ecr-utils.git
[2017-02-23 20:17:47] Slack Webhook:      hhttps://hooks.slack.com/services/superneattokenyo
[2017-02-23 20:17:47] AWS Region:         us-west-2
[2017-02-23 20:17:47] CF Template:        templates/sns-lambda-codebuild-ecr.json
[2017-02-23 20:17:47] Stack Name:         ecr-utils-sns-lambda-codebuild-ecr
[2017-02-23 20:17:47] Full Template Path: file:////usr//src//ecr-utils//templates//sns-lambda-codebuild-ecr.json
[2017-02-23 20:17:47] Starting Stack Build
[2017-02-23 20:17:50] Stack ID: arn:aws:cloudformation:us-west-2:00000000000:stack/ecr-utils-sns-lambda-codebuild-ecr/70578cf0-fa37-11e6-9f4b-503f2a2ceee6
...............
[2017-02-23 20:19:20] Stack Status: CREATE_COMPLETE
[2017-02-23 20:19:22] Info for Github Service Integration:
[2017-02-23 20:19:22]  == AWS Region: us-west-2
[2017-02-23 20:19:23]  == SNS Topic ARN: "arn:aws:sns:us-west-2:00000000000:lambda-ecr-utils-git"
[2017-02-23 20:19:23]  == AWS Access Key ID: "AKIAJVJLSVDCNSLT4K3A"
[2017-02-23 20:19:24]  == AWS Secret Key: "superSecretAccessKeyWithLimitedPrivs"
[2017-02-23 20:19:25]  == AWS ECR Repo URL: "00000000000.dkr.ecr.us-west-2.amazonaws.com/ecr-utils"
[2017-02-23 20:19:25] Stack created! (ecr-utils-sns-lambda-codebuild-ecr)

Install Utilities

curl https://raw.githubusercontent.com/synctree/eb-utils/master/install.sh | bash -

CircleCI circle.yml

---
dependencies:
  pre:
    - curl https://raw.githubusercontent.com/synctree/ecr-utils/master/install.sh | bash -

test:
  post:
    - /usr/local/bin/cb -p $CODEBUILD_PROJECT -e $ECR_REPO -b $CIRCLE_BRANCH

AWS CodeBuild buildspec.yml

version: 0.1

phases:
  pre_build:
    commands:
      - curl https://raw.githubusercontent.com/synctree/ecr-utils/master/install.sh | bash -
  build:
    commands:
      - /usr/local/bin/build-image -w $SLACK_WEBHOOK -e $ECR_URL -n $ECR_REPO_NAME
  post_build:
    commands:
      - echo "[`date`] Build Complete."

ecr-utils's People

Contributors

clok avatar

Watchers

James Cloos avatar  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.