project salt-deployhook

Tags:
saltstack webhook
Status:
beta

I gave a presentation at LINE Developer Meetup #47 in Fukuoka entitled Automating deployments from GitHub using SaltStack .

I have been using this both for my development environment and at work to automate deployments from Github to Salt.

# salt-master configuration

# Ensure that our custom state tree can be found in addition
# to our default salt states
file_roots:
  base:
    - /srv/salt
    - /srv/salt-deployhook

# For our example, enable the webhook engine with default values
engines:
  - webhook: {}

# A post to our salt master ( https://salt.example.com/github )
# Will map to our reactor ( salt://_reactor/autodeploy.sls)
reactor:
  - "salt/engines/hook/github":
      - salt://_reactor/autodeploy.sls
#!yaml|github
# salt://_reactor/autodeploy.sls
example/webapp:
  refs/heads/master:
    deploy_webapp:
      local.state.sls:
        - tgt: role:webserver
        - tgt_type: grain
        - args:
            - mods: mywebapp