Code Monkey home page Code Monkey logo

deployer's Introduction

deployer

Build Status Go Report Card

๐Ÿ“Ÿ A tool for fetching, building, pushing and deploying applications.

Install

$ go get github.com/pagarme/deployer

Usage

deployer command [options] <path>

Commands:
  deploy    Deploy an application using a configuration file

Options:
  --ref     Source Code Management hash to be fetched (default: master)
  --env     Environment to be used (default: main)

Configuration File

To deploy an application you must specify a yml configuration file (e.g. deployer.yml), that consists in steps and environment configuration. A typical configuration file has the following structure:

scm:
  type: <type>

build:
  type: <type>

deploy:
  type: <type>

environments:
  sandbox:
    name: sandbox
  live:
    name: live

Note: The order the steps appear in the configuration file, does not determine the order they will be executed. Check Steps for more information.

Steps

The deployer deploys application executing different steps, one after the other. The order the steps are executed is: scm -> build -> deploy

SCM (Source Code Management)

Available types are: git.

Git

The Git SCM Step clones a git repository with an specified hash and adds it to a temporary folder.

Options:

Options Description
repository The git repository to be cloned
ref The ref of the repository to be used. Can be a branch or the sha of a commit. Defaults to master or the ref passed via flag --ref

Example:

scm:
  type: git
  repository: https://github.com/pagarme/deployer
  ref: master

Build

Available types are: rocker.

Rocker

The Rocker Build step builds and pushes a specified Rockerfile. The following variables are injected when building the Rockerfile:

  1. RepositoryPath: The location of the cloned repository from the SCM step
  2. ImageSHA: The sha of the ref from the SCM step
  3. ImageRepository: The repository where the Rocker image will be pushed

For more information about Rocker, check the official documentation (https://github.com/grammarly/rocker)

Options:

Options Description
build_directory The location of the Rockerfile. Defaults to current directory
image_repository The repository where the Rocker image will be pushed

Example:

build:
  type: rocker
  build_directory: path/to
  image_repository: xxxxxx.dkr.ecr.us-east-1.amazonaws.com/deployer # Pushing the image to an AWS ECR

Deploy

Available types are: lambda and nomad.

Lambda

The Lambda Deploy step updates and deploys existing AWS Lambda functions. It creates a zip file, uploads it to a S3 Bucket and updates the Lambda functions code.

Note: This step does not create the AWS Lambda functions, but instead updates existing functions code.

Options:

Options Description
region The AWS region the functions are deployed.
s3_bucket The name of the AWS S3 Bucket that will be used to upload the functions zipped source code
package The source code of the functions. A list of folders and files to include in the zip.

Environment:

Options Description
name The name of the environment. This will be used to compose the S3 key object.
functions A list of the AWS Lambda functions that will be updated

Example:

deploy:
  type: lambda
  region: us-east-1
  s3_bucket: pagarme-deploy-s3-bucket
  package: # This will create a zip containing the `dist` and the `node_modules` folders
    - dist
    - node_modules

environment:
  live:
    name: live
    functions:
      - hello
      - cowsay

deployer's People

Contributors

greenboxal avatar grvcoelho avatar

Watchers

 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.