Merge lp:~pwlars/charms/trusty/jenkins/ci-ubiquity-local-install into lp:~canonical-ci-engineering/charms/trusty/jenkins/ubiquity

Proposed by Paul Larson
Status: Merged
Merged at revision: 49
Proposed branch: lp:~pwlars/charms/trusty/jenkins/ci-ubiquity-local-install
Merge into: lp:~canonical-ci-engineering/charms/trusty/jenkins/ubiquity
Diff against target: 118 lines (+22/-24)
4 files modified
README.ubiquity-testing (+6/-0)
config.yaml (+1/-5)
deploy.yaml (+1/-5)
hooks/install (+14/-14)
To merge this branch: bzr merge lp:~pwlars/charms/trusty/jenkins/ci-ubiquity-local-install
Reviewer Review Type Date Requested Status
Joe Talbott (community) Approve
Paul Larson Needs Resubmitting
Review via email: mp+250760@code.launchpad.net

Description of the change

Bring back Joseph's much better idea of allowing installation of jenkins from a files dir, and also add in plugin installation from there.

To post a comment you must log in.
52. By Paul Larson

add back the ubiquity-branch

Revision history for this message
Joe Talbott (joetalbott) wrote :

One minor thing in-line.

review: Needs Fixing
53. By Paul Larson

Remove support for url install method

Revision history for this message
Paul Larson (pwlars) wrote :

URL removeda

review: Needs Resubmitting
Revision history for this message
Joe Talbott (joetalbott) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'README.ubiquity-testing'
2--- README.ubiquity-testing 1970-01-01 00:00:00 +0000
3+++ README.ubiquity-testing 2015-02-24 15:20:34 +0000
4@@ -0,0 +1,6 @@
5+To use this with release=local, you'll need to create a files directory
6+with a jenkins .deb you want it to install, and all of the plugins you
7+specified for it to install. The ones I'm using currently can be found
8+at:
9+jenkins: http://people.canonical.com/~plars/jenkins/
10+plugins: http://people.canonical.com/~plars/jenkins/plugins/latest/
11
12=== modified file 'config.yaml'
13--- config.yaml 2015-02-19 22:29:46 +0000
14+++ config.yaml 2015-02-24 15:20:34 +0000
15@@ -10,7 +10,7 @@
16 Source of Jenkins, options include:
17 - lts: use the most recent Jenkins LTS release.
18 - trunk: use the most recent Jenkins release.
19- - url: use the url in release-url to fetch a jenkins .deb to install
20+ - local: use the jenkins .deb and plugins in the files/ directory
21 username:
22 type: string
23 default: admin
24@@ -43,7 +43,3 @@
25 type: string
26 default: lp:ubiquity
27 description: bzr branch to pull for ubiquity tests
28- release-url:
29- type: string
30- default: http://example.com/jenkins.deb
31- description: Url for jenkins package to install
32
33=== modified file 'deploy.yaml'
34--- deploy.yaml 2015-02-20 19:06:40 +0000
35+++ deploy.yaml 2015-02-24 15:20:34 +0000
36@@ -8,9 +8,5 @@
37 options:
38 plugins: parameterized-trigger build-publisher mailer urltrigger next-build-number
39 username: admin
40- #if you don't specify, it uses distro - might be what we
41- #use for train because we want to use cat instead
42- release: url
43- release-url: http://people.canonical.com/~josepht/jenkins_1.580.2_all.deb
44- plugins-site: http://people.canonical.com/~plars/jenkins/plugins
45+ release: local
46 ubiquity-branch: lp:~canonical-ci-engineering/ubiquity/ubiquity-ci-testing
47
48=== modified file 'hooks/install'
49--- hooks/install 2015-02-19 23:33:34 +0000
50+++ hooks/install 2015-02-24 15:20:34 +0000
51@@ -2,6 +2,7 @@
52
53 set -eu
54
55+FILES=$(pwd)/files
56 RELEASE=$(config-get release)
57 ADMIN_USERNAME=$(config-get username)
58 ADMIN_PASSWORD=$(config-get password)
59@@ -11,8 +12,8 @@
60 REMOVE_UNLISTED_PLUGINS=$(config-get remove-unlisted-plugins)
61 CWD=$(dirname $0)
62 JENKINS_HOME=/var/lib/jenkins
63-RELEASE_URL=$(config-get release-url)
64-URL="false"
65+LOCAL="false"
66+SOURCE=""
67
68 setup_source () {
69 # Do something with < Oneiric releases - maybe PPA
70@@ -27,13 +28,13 @@
71 SOURCE="debian-stable";;
72 trunk)
73 SOURCE="debian";;
74- url)
75- URL="true";;
76+ local)
77+ LOCAL="true";;
78 *)
79 juju-log "release configuration not recognised" && exit 1;;
80 esac
81
82- if [ "$URL" != "true" ]; then
83+ if [ -n "$SOURCE" ]; then
84 # Setup archive to use appropriate jenkins upstream
85 wget -q -O - http://pkg.jenkins-ci.org/$SOURCE/jenkins-ci.org.key | apt-key add -
86 echo "deb http://pkg.jenkins-ci.org/$SOURCE binary/" \
87@@ -50,15 +51,10 @@
88 install_jenkins () {
89 juju-log "Installing/upgrading jenkins..."
90
91- apt-get -y install -qq default-jre-headless
92+ apt-get -y install -qq default-jre-headless daemon
93
94- if [ "$RELEASE" = "url" ]; then
95- PKG=files/jenkins.deb
96- wget -O $PKG $RELEASE_URL
97- if [ -f $PKG ]; then
98- apt-get -y install -qq daemon
99- dpkg -i $PKG
100- fi
101+ if [ "$LOCAL" = "true" ]; then
102+ dpkg -i ${FILES}/*.deb
103 else
104 apt-get -y install -qq jenkins
105 fi
106@@ -117,7 +113,11 @@
107 if [ "$PLUGINS_CHECK_CERT" = "no" ] ; then
108 opts="--no-check-certificate"
109 fi
110- wget $opts --timestamping $PLUGINS_SITE/latest/$plugin.hpi
111+ if [ "$RELEASE" = "local" ]; then
112+ cp ${FILES}/$plugin.hpi $plugin_file
113+ else
114+ wget $opts --timestamping $PLUGINS_SITE/latest/$plugin.hpi
115+ fi
116 chmod a+r $plugin_file
117 rm -f $track_dir/$plugin.hpi
118 done

Subscribers

People subscribed via source and target branches