Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
trebuchet-trigger (0.5.5-1) precise; urgency=low

* Update for yaml format args to publish.runner

-- Ariel T. Glenn <ariel@wikimedia.org> Sat, 09 May 2015 08:32:56 +0000

trebuchet-trigger (0.5.4-1) precise; urgency=low

* Catch exception for config when not in repo
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

setup(
name="TrebuchetTrigger",
version="0.5.4",
version="0.5.5",
packages=find_packages(),
install_requires=['GitPython>=0.3.2.RC1', 'PyYAML>=3.10', 'redis>=2.4.9'],
install_requires=['GitPython>=0.3.2.RC1', 'PyYAML>=3.10', 'redis>=2.4.9', 'salt'],

author="Ryan Lane",
author_email="ryan@ryandlane.com",
Expand Down
24 changes: 22 additions & 2 deletions trigger/drivers/trebuchet/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

import redis

import salt.version

from datetime import datetime
from trigger.drivers import SyncDriverError
from trigger.drivers import LockDriverError
Expand Down Expand Up @@ -94,8 +96,17 @@ def _fetch(self, args):
def _checkout(self, args):
# TODO (ryan-lane): Check return values from these commands
repo_name = self.conf.config['deploy.repo-name']
if args.force:
# see https://github.com/saltstack/salt/issues/18317
_version_ = salt.version.SaltStackVersion(*salt.version.__version_info__)
if (_version_ >= "2014.7.3"):
runner_args = '[' + repo_name + ',' + str(args.force) + ']'
else:
runner_args = repo_name + ',' + str(args.force)
else:
runner_args = repo_name
p = subprocess.Popen(['sudo','salt-call','-l','quiet','publish.runner',
'deploy.checkout', repo_name+','+str(args.force)],
'deploy.checkout', runner_args],
stdout=subprocess.PIPE)
p.communicate()

Expand Down Expand Up @@ -206,9 +217,18 @@ def __init__(self, conf):

def restart(self, args):
repo_name = self.conf.config['deploy.repo-name']
if args.batch:
# see https://github.com/saltstack/salt/issues/18317
_version_ = salt.version.SaltStackVersion(*salt.version.__version_info__)
if (_version_ >= "2014.7.3"):
runner_args = '[' + repo_name + ',' + str(args.batch) + ']'
else:
runner_args = repo_name +',' + str(args.batch)
else:
runner_args = repo_name
p = subprocess.Popen(['sudo','salt-call','-l','quiet','--out=json',
'publish.runner','deploy.restart',
repo_name+','+str(args.batch)],
runner_args],
stdout=subprocess.PIPE)
out = p.communicate()[0]
## Disabled until salt bug is fixed:
Expand Down