Merge lp:~joetalbott/charms/trusty/jenkins/add_local_deb into lp:~canonical-ci-engineering/charms/trusty/jenkins/ubiquity

Proposed by Joe Talbott
Status: Merged
Merged at revision: 46
Proposed branch: lp:~joetalbott/charms/trusty/jenkins/add_local_deb
Merge into: lp:~canonical-ci-engineering/charms/trusty/jenkins/ubiquity
Diff against target: 99 lines (+45/-6)
3 files modified
config.yaml (+5/-0)
deploy.yaml (+14/-0)
hooks/install (+26/-6)
To merge this branch: bzr merge lp:~joetalbott/charms/trusty/jenkins/add_local_deb
Reviewer Review Type Date Requested Status
Paul Larson Approve
Review via email: mp+250386@code.launchpad.net

Commit message

Add support for deploying a local jenkins debian package.

Description of the change

Add support for deploying a local jenkins debian package.

To post a comment you must log in.
45. By Joe Talbott

Add support for deploying with a local copy of a jenkins debian package.

46. By Joe Talbott

Use a URL for the jenkins deb rather than including the deb itself.

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

Some minor comments, otherwise looks fine.

review: Approve
47. By Joe Talbott

Minor clean up.

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

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2015-02-18 03:46:19 +0000
3+++ config.yaml 2015-02-19 23:27:45 +0000
4@@ -10,6 +10,7 @@
5 Source of Jenkins, options include:
6 - lts: use the most recent Jenkins LTS release.
7 - trunk: use the most recent Jenkins release.
8+ - url: use the url in release-url to fetch a jenkins .deb to install
9 username:
10 type: string
11 default: admin
12@@ -42,3 +43,7 @@
13 type: string
14 default: lp:ubiquity
15 description: bzr branch to pull for ubiquity tests
16+ release-url:
17+ type: string
18+ default: http://example.com/jenkins.deb
19+ description: Url for jenkins package to install
20
21=== added file 'deploy.yaml'
22--- deploy.yaml 1970-01-01 00:00:00 +0000
23+++ deploy.yaml 2015-02-19 23:27:45 +0000
24@@ -0,0 +1,14 @@
25+ubiquity-testing:
26+ # Quick test to see if this works
27+ series: trusty
28+ services:
29+ ubiquity-jenkins:
30+ charm: local:trusty/jenkins
31+ options:
32+ plugins: parameterized-trigger build-publisher mailer urltrigger
33+ username: admin
34+ #if you don't specify, it uses distro - might be what we
35+ #use for train because we want to use cat instead
36+ release: url
37+ release-url: http://people.canonical.com/~josepht/jenkins_1.580.2_all.deb
38+ ubiquity-branch: lp:~canonical-ci-engineering/ubiquity/ubiquity-ci-testing
39
40=== added directory 'files'
41=== modified file 'hooks/install'
42--- hooks/install 2014-04-17 12:35:18 +0000
43+++ hooks/install 2015-02-19 23:27:45 +0000
44@@ -11,6 +11,8 @@
45 REMOVE_UNLISTED_PLUGINS=$(config-get remove-unlisted-plugins)
46 CWD=$(dirname $0)
47 JENKINS_HOME=/var/lib/jenkins
48+RELEASE_URL=$(config-get release-url)
49+URL="false"
50
51 setup_source () {
52 # Do something with < Oneiric releases - maybe PPA
53@@ -25,14 +27,19 @@
54 SOURCE="debian-stable";;
55 trunk)
56 SOURCE="debian";;
57+ url)
58+ URL="true";;
59 *)
60 juju-log "release configuration not recognised" && exit 1;;
61 esac
62- # Setup archive to use appropriate jenkins upstream
63- wget -q -O - http://pkg.jenkins-ci.org/$SOURCE/jenkins-ci.org.key | apt-key add -
64- echo "deb http://pkg.jenkins-ci.org/$SOURCE binary/" \
65- > /etc/apt/sources.list.d/jenkins.list
66- apt-get update || true
67+
68+ if [ "$URL" != "true" ]; then
69+ # Setup archive to use appropriate jenkins upstream
70+ wget -q -O - http://pkg.jenkins-ci.org/$SOURCE/jenkins-ci.org.key | apt-key add -
71+ echo "deb http://pkg.jenkins-ci.org/$SOURCE binary/" \
72+ > /etc/apt/sources.list.d/jenkins.list
73+ apt-get update || true
74+ fi
75 }
76 # Only setup the source if jenkins is not already installed
77 # this makes the config 'release' immutable - i.e. you
78@@ -42,7 +49,20 @@
79 # Install jenkins
80 install_jenkins () {
81 juju-log "Installing/upgrading jenkins..."
82- apt-get -y install -qq jenkins default-jre-headless
83+
84+ apt-get -y install -qq default-jre-headless
85+
86+ if [ "$RELEASE" = "url" ]; then
87+ PKG=files/jenkins.deb
88+ wget -O $PKG $RELEASE_URL
89+ if [ -f $PKG ]; then
90+ apt-get -y install -qq daemon
91+ dpkg -i $PKG
92+ fi
93+ else
94+ apt-get -y install -qq jenkins
95+ fi
96+
97 }
98 # Re-run whenever called to pickup any updates
99 install_jenkins

Subscribers

People subscribed via source and target branches