Giter VIP home page Giter VIP logo

gh-provision-envs's Introduction

GitHub Environment Provisioning

A GitHub CLI command to provision environments with secrets and variables from a configuration file.

Requirements

  • The GitHub CLI tool
  • Administrative permissions on the GitHub repositories you want to run this on
  • NodeJS 18.x or newer

Usage

You can install this as an extension to the gh CLI tool. At its simplest, you give it a JSON config file and a repository name:

gh extension install AyogoHealth/gh-provision-envs
gh provision-envs -c config.json -R myuser/myrepo

Disclaimers

  • This will overwrite variable and secret values if they already exist!
  • This is a bit of a hack, cobbled together by spawning other gh commands
  • If your secret/variable values contain double quotes, you'll maybe have a bad time...
  • If you try to break it, you almost definitely will

Config File Format

The config file must be a valid JSON file, consisting of an object with an environments key that contains the environments you would like to provision.

Example

{
  "environments": {
    "staging": {
      "variables": [
        {
          "name": "HOSTNAME",
          "value": "staging.example.com"
        }
      ],
      "secrets": [
        {
          "name": "DEPLOY_KEY_PASSWORD",
          "value": "MySecretPassword1"
        }
      ]
    },
    "production": {
      "variables": [
        {
          "name": "HOSTNAME",
          "value": "example.com"
        }
      ],
      "secrets": [
        {
          "name": "DEPLOY_KEY_PASSWORD",
          "value": "MySecretPassword2"
        },
        {
          "name": "SECRET_PRODUCTION_VALUE",
          "value": "ThisIsASecret"
        }
      ]
    }
  }
}

Contributing

Contributions of bug reports, feature requests, and pull requests are greatly appreciated!

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Licence

Released under the MIT Licence.

Copyright © 2023 Ayogo Health Inc.

gh-provision-envs's People

Contributors

dpogue avatar isuda avatar

Stargazers

Daniel Bodnar avatar  avatar hehe.bu avatar Pulkit Kathuria avatar Tomoatsu Sekikawa avatar Druskus avatar Niels van der Vlist avatar Bartosz Sławecki 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.