Code Monkey home page Code Monkey logo

deployer's Introduction

deployer

Build Status Go Report Card

๐Ÿ“Ÿ A tool for deploying applications.

Install

$ go get github.com/pagarme/deployer

Usage

deployer command [options] <path>

Commands:
  deploy    Deploy an application using a configuration file

Options:
  --env     Environment to be used (default: main)
  --img     Docker Image to be used

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:

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.

Also in order to send the logs to DynamoDB, the following environment variables must be set:

  • DEPLOYER_DYNAMODB_TABLE: DynamoDB's log table
  • DEPLOYER_AWS_REGION: AWS region

Deploy

Only nomad, example file:

deploy.yml

---
deploy:
  type: nomad
  job_files:
    - application.nomad

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

application.nomad

job "application-{{ .Environment.name }}" {
  type        = "system"
  region      = "global"
  datacenters = ["dc1"]

  constraint {
    attribute = "${node.class}"
    value     = "application-{{ .Environment.name }}"
  }

  update {
    stagger      = "5s"
    max_parallel = 1
  }

  group "web" {
    task "nginx" {
      driver = "docker"

      config {
        image      = "{{ .Image }}"
        force_pull = true

        port_map {
          "http" = 80
        }

        dns_servers = ["${attr.unique.network.ip-address}"]
      }

      env {
        CONFIG_VERSION = "v1"
        CONSUL_ADDR    = "${attr.unique.network.ip-address}:8500"
      }

      service {
        name = "application-{{ .Environment.name }}"

        tags = ["application"]

        port = "http"

        check {
          name     = "http check"
          type     = "http"
          port     = "http"
          path     = "/_health_check"
          interval = "5s"
          timeout  = "2s"
        }

        check {
          name = "Status Information Health Check"
          type = "http"
          port = "http"
          path = "/_status"
          interval = "5s"
          timeout = "2s"
        }
      }

      resources {
        cpu    = "2400"
        memory = "3584"

        network {
          mbits = 100

          port "http" {
            static = 80
          }
        }
      }
    }
  }
}

deployer's People

Contributors

claytonsilva avatar evaporei avatar greenboxal avatar grvcoelho avatar hails avatar jvrmaia avatar vidalvasconcelos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deployer's Issues

Add zip step

ATM, Lambda deploy zips a package before sending to S3. Maybe, the zip package can be another step.

Add docs

Add documentation to README.md.

Needed information:

  • How to use/install it
  • Configuration File
  • Steps (scm, build, deploy)
  • Types of Steps (scm-git, build-rocker, deploy-nomad, deploy-lambda)

feature: add actions log

Currently, the project lacks proper logs about what's happening.
We should implement some sort of logging, reporting which command was issued and who issued the command. Also, we should log step-by-step everything that's being done.

feature: send logs to DynamoDB

One step further than just having logs as #11 is also logging to some external storage, such as DynamoDB, in order to have a single source of truth regarding what's been done.

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.