~fginther/jenkins-launchpad-plugin/getPackageVersion-dev

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#login of the launchpad user you will be using for this plugin
#ideally this user is part of your project group
LAUNCHPAD_LOGIN='martin-mrazik+qa'
#Review type that is used for voting on merge proposals.
#Usually you don't need to change this
LAUNCHPAD_REVIEW_TYPE='continuous-integration'
#path to your credentials file. The first time you run one of these scripts,
#launchpad will ask you to authenticate (via a provided URL). Once you do so 
#(in launchpad) you won't need to do this again.
#If your jenkins "lives" in /var/lib/jenkins you probably don't need to change
#this
CREDENTIAL_STORE_PATH='/var/lib/jenkins/.launchpad.credentials'
#you don't need to change this
LP_APP='launchpad-trigger'
#which launchpad are you using (production/staging)
#you don't need to change this
LP_ENV='production'
#currently not used
LAUNCHPAD_MESSAGE=""
#message that is used for "testing in progress" comment
LAUNCHPAD_BUILD_IN_PROGRESS_MESSAGE='Jenkins: testing in progress'
#lock file that is being used to limit the number of parallel launchpad
#connections
LOCK_FILE='/tmp/launchpad-trigger.lock'
#URL of your jenkins. 
JENKINS_URL='http://localhost:8080/'
#URL of your public jenkins in case you are publishing your jobs to some 
#other jenkins
PUBLIC_JENKINS_URL='http://jenkins.qa.ubuntu.com'
#user and password for accessing jenkins. This is needed as we need to find
#out if a job is being published to public jenkins or not. The user needs to be 
#able to see the job configuration
JENKINS_USER='jenkins-user'
JENKINS_PASSWORD='jenkins-password'
#You must explicitely allow users to trigger the jobs on your jenkins
#Otherwise anybody can run arbitrary code on your jenkins servers.
ALLOWED_USERS=['martin-mrazik+qa','mrazik']
#in case you are running jenkins in a private infrastructure you probably don't
#want to expose your private IPs in public merge proposals
#the following defines (IP, replacement) pairs. Your URLs in merge proposals are
#then replaced by the replacement (and you can e.g. edit your /etc/hosts so the
#links still work for you).
URLS_TO_HIDE=[('http://10.0.0.1:8080','http://jenkins:8080'),('http://10.0.0.2:8080','http://jenkins2:8080')]

# directory containing lockfiles for Launchpad merge proposals
LAUNCHPADLOCKS_DIR = '/tmp/jenkins-launchpad-plugin/locks'

import logging
import sys
from logging import StreamHandler
from logging import Formatter

logger = logging.getLogger('jenkins-launchpad-plugin')
logger.setLevel(logging.DEBUG)
stdout_handler = StreamHandler(stream=sys.stdout)
stdout_handler.setLevel(logging.DEBUG)
formatter = Formatter('%(levelname)s: %(message)s')
stdout_handler.setFormatter(formatter)
logger.addHandler(stdout_handler)