summaryrefslogtreecommitdiff
path: root/jenkinstool
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2012-08-27 15:49:17 +0100
committerLars Wirzenius <liw@liw.fi>2012-08-27 15:49:17 +0100
commit1350a91d44b1dab4c5db3059f497f5e48040dc7f (patch)
treeecb32d8803f915a6b47bb3d65bf5ba2e8164bd0b /jenkinstool
parent0599e00d9bd2043787a13fc2575ce8cce5524146 (diff)
downloadjenkinstool-1350a91d44b1dab4c5db3059f497f5e48040dc7f.tar.gz
Allow (nay, require) user to specify artifacts-url
Diffstat (limited to 'jenkinstool')
-rwxr-xr-xjenkinstool14
1 files changed, 11 insertions, 3 deletions
diff --git a/jenkinstool b/jenkinstool
index 27cc4e3..7af0bc4 100755
--- a/jenkinstool
+++ b/jenkinstool
@@ -119,9 +119,10 @@ class JobGenerator(object):
'''Generate Jenkins jobs from a JSON specification file.'''
- def __init__(self, pretend, pbuilder_max_age):
+ def __init__(self, pretend, pbuilder_max_age, artifacts_url):
self.pretend = pretend
self.pbuilder_max_age = pbuilder_max_age
+ self.artifacts_url = artifacts_url
def generate(self, config):
'''Generate all the jobs for a given config.
@@ -533,7 +534,7 @@ rm -rf "$temp"
jc.add_param_dict('host', host)
jc.add_param_dict('global', {
'artifacts': '/var/www/jenkins',
- 'artifacts-url': 'http://192.168.122.218/jenkins',
+ 'artifacts-url': self.artifacts_url,
'dput-host': 'liw-jenkins',
'repreprobase': '/var/www/jenkins/debian',
'debian-mirror': 'http://cdn.debian.net/debian',
@@ -575,6 +576,9 @@ class JenkinsTool(cliapp.Application):
'update pbuilder base.tgz if older than DAYS',
metavar='DAYS',
default=7)
+ self.settings.string(
+ ['artifacts-url'],
+ 'URL to artifact repository')
def cmd_list_jobs(self, args):
'''List all jobs on the server.'''
@@ -616,9 +620,13 @@ class JenkinsTool(cliapp.Application):
def cmd_generate_jobs(self, args):
'''Generate jobs based on JSON format job specification file.'''
+
+ self.settings.require('artifacts-url')
+
jenkins = simplejenkinsapi.Jenkins(self.settings['url'])
job_generator = JobGenerator(self.settings['pretend-jobs'],
- self.settings['pbuilder-max-age'])
+ self.settings['pbuilder-max-age'],
+ self.settings['artifacts-url'])
created_job_ids = set()
for filename in args:
with open(filename) as f: