Skip to content

Instantly share code, notes, and snippets.

@kevinquinnyo
Created February 3, 2016 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinquinnyo/1997f6f5f362777e5e8f to your computer and use it in GitHub Desktop.
Save kevinquinnyo/1997f6f5f362777e5e8f to your computer and use it in GitHub Desktop.
#!py
import json
import os
from urlparse import urlparse
def run():
pillars = __salt__['pillar.items']('*')
return pillars
ret = {}
payload = json.loads(data['body'])
ref = payload['ref']
repository = payload['repository']['name']
git_http_url = urlparse(payload['repository']['git_http_url'])
gitlab_minion = git_http_url.netloc
branch = os.path.basename(os.path.normpath(ref))
if branch in ['master', 'staging']:
ret['pull-from-gitlab'] = {
'runner.git.pull': [
{'hook_data': payload}
]
}
return ret
@kevinquinnyo
Copy link
Author

issue was on line 8

doh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment