Created
February 3, 2016 19:16
-
-
Save kevinquinnyo/1997f6f5f362777e5e8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
issue was on line 8
doh