remind101 / slashdeploy

GitHub Deployments for Slack
https://slashdeploy.io
BSD 2-Clause "Simplified" License
153 stars 20 forks source link

Support configuring environments via .slashdeploy.yml #101

Closed ejholmes closed 6 years ago

ejholmes commented 6 years ago

Closes https://github.com/remind101/slashdeploy/issues/94 Fixes https://github.com/remind101/slashdeploy/issues/50

Since the move to a GitHub Integration, it makes it easy to support configuring a repositories known environments (and continuous delivery settings), via a file in the root of the repository, similar to something like .circleci or .travis.yml.

With this change, you can now add a .slashdeploy.yml to the root of a repositories default branch, and SlashDeploy will use that as it's source for determining what environments can be deployed to.

Here's a simple example that configures two environments, one in which we continously deliver the "master" branch to:

---
environments:
  production:

    # Allows us to reference this using "production" or a short alias, "prod".
    aliases:
      - prod

    # Enable continuous delivery for this environment.
    continuous_delivery:
      # You can specify any git "ref" (tag, branch, etc) to auto deploy when
      # pushed to.
      ref: refs/heads/master

      # If you want to only deploy when a set of GitHub commit statuses are
      # passing, you can configure those here. If none are provided, SlashDeploy
      # will deploy when new commits are pushed to the git ref.
      required_contexts:
        - ci/circleci

  staging:
    aliases:
      - stage

I think this is a big improvement over what we had before (basically nothing), and better than having some kind of UI to do the configuration.