Coder Social home page Coder Social logo

github-deploy's Introduction

github-deploy - Track deployments on GitHub

built with nix

An opinionated command-line utility that integrates deployments with the github Deployment API.

Description

This is a wrapper command that abstracts the deployment method through a set of scripts which interfaces are clearly defined.

The wrapper command tracks the deployment statuses by interacting with the github API.

Assumptions

The command is being run in the checkout of the project that is about to be deployed, with the right git commit checked out.

Usage

$ ./github-deploy --help

NAME:
   github-deploy - A CLI that integrates deployments with github

USAGE:
   github-deploy [global options] command [command options] [arguments...]

VERSION:
   0.6.1

AUTHOR:
   zimbatm <[email protected]>

COMMANDS:
     please   Initiates a deployment
     cleanup  Removes deployments
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --git-commit value    git commit ID [$GITHUB_SHA, $BUILDKITE_COMMIT, $CIRCLE_SHA1, $TRAVIS_PULL_REQUEST_SHA]
   --git-branch value    git branch [$GITHUB_REF, $BUILDKITE_BRANCH, $CIRCLE_BRANCH, $TRAVIS_BRANCH]
   --git-origin value    URL of the repo [$BUILDKITE_REPO, $CIRCLE_REPOSITORY_URL]
   --git-ref-commit      use the commit as deployment reference instead of branch
   --github-token value  Github Personal access token to interact with the Github API (default: <secret:github-token>) [$GITHUB_TOKEN]
   --help, -h            show help
   --version, -v         print the version

Scripts interface

DEPLOY_SCRIPT <TARGET>

The deploy script takes an optional deployment name an argument and returns the target URL on stdout.

Depending on the script exit status, the deployment is marked as a failure or success.

LIST_SCRIPT

Returns the list of all the temporary deployments on stdout.

UNDEPLOY_SCRIPT <TARGET>

Deletes a deployment named <TARGET>. Should not undeploy production.

Install

To install, use go get:

$ go get -d github.com/zimbatm/github-deploy

Setup

Create a token

Go to https://github.com/settings/tokens/new

Select repo

export GITHUB_TOKEN=

Create the wrapper scripts

TODO example

Contribution

  1. Fork (https://github.com/zimbatm/github-deploy/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the main branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create a new Pull Request

Author

zimbatm

License

MIT

github-deploy's People

Contributors

dependabot[bot] avatar jfroche avatar nmattia avatar zimbatm avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jfroche nali-ocb

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.