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
=== added file 'README.ubiquity-testing'
--- README.ubiquity-testing 1970-01-01 00:00:00 +0000
+++ README.ubiquity-testing 2015-02-24 15:20:34 +0000
@@ -0,0 +1,6 @@
1To use this with release=local, you'll need to create a files directory
2with a jenkins .deb you want it to install, and all of the plugins you
3specified for it to install. The ones I'm using currently can be found
4at:
5jenkins: http://people.canonical.com/~plars/jenkins/
6plugins: http://people.canonical.com/~plars/jenkins/plugins/latest/
07
=== modified file 'config.yaml'
--- config.yaml 2015-02-19 22:29:46 +0000
+++ config.yaml 2015-02-24 15:20:34 +0000
@@ -10,7 +10,7 @@
10 Source of Jenkins, options include:10 Source of Jenkins, options include:
11 - lts: use the most recent Jenkins LTS release.11 - lts: use the most recent Jenkins LTS release.
12 - trunk: use the most recent Jenkins release.12 - trunk: use the most recent Jenkins release.
13 - url: use the url in release-url to fetch a jenkins .deb to install13 - local: use the jenkins .deb and plugins in the files/ directory
14 username:14 username:
15 type: string15 type: string
16 default: admin16 default: admin
@@ -43,7 +43,3 @@
43 type: string43 type: string
44 default: lp:ubiquity44 default: lp:ubiquity
45 description: bzr branch to pull for ubiquity tests45 description: bzr branch to pull for ubiquity tests
46 release-url:
47 type: string
48 default: http://example.com/jenkins.deb
49 description: Url for jenkins package to install
5046
=== modified file 'deploy.yaml'
--- deploy.yaml 2015-02-20 19:06:40 +0000
+++ deploy.yaml 2015-02-24 15:20:34 +0000
@@ -8,9 +8,5 @@
8 options:8 options:
9 plugins: parameterized-trigger build-publisher mailer urltrigger next-build-number9 plugins: parameterized-trigger build-publisher mailer urltrigger next-build-number
10 username: admin10 username: admin
11 #if you don't specify, it uses distro - might be what we11 release: local
12 #use for train because we want to use cat instead
13 release: url
14 release-url: http://people.canonical.com/~josepht/jenkins_1.580.2_all.deb
15 plugins-site: http://people.canonical.com/~plars/jenkins/plugins
16 ubiquity-branch: lp:~canonical-ci-engineering/ubiquity/ubiquity-ci-testing12 ubiquity-branch: lp:~canonical-ci-engineering/ubiquity/ubiquity-ci-testing
1713
=== modified file 'hooks/install'
--- hooks/install 2015-02-19 23:33:34 +0000
+++ hooks/install 2015-02-24 15:20:34 +0000
@@ -2,6 +2,7 @@
22
3set -eu3set -eu
44
5FILES=$(pwd)/files
5RELEASE=$(config-get release)6RELEASE=$(config-get release)
6ADMIN_USERNAME=$(config-get username)7ADMIN_USERNAME=$(config-get username)
7ADMIN_PASSWORD=$(config-get password)8ADMIN_PASSWORD=$(config-get password)
@@ -11,8 +12,8 @@
11REMOVE_UNLISTED_PLUGINS=$(config-get remove-unlisted-plugins)12REMOVE_UNLISTED_PLUGINS=$(config-get remove-unlisted-plugins)
12CWD=$(dirname $0)13CWD=$(dirname $0)
13JENKINS_HOME=/var/lib/jenkins14JENKINS_HOME=/var/lib/jenkins
14RELEASE_URL=$(config-get release-url)15LOCAL="false"
15URL="false"16SOURCE=""
1617
17setup_source () {18setup_source () {
18 # Do something with < Oneiric releases - maybe PPA19 # Do something with < Oneiric releases - maybe PPA
@@ -27,13 +28,13 @@
27 SOURCE="debian-stable";;28 SOURCE="debian-stable";;
28 trunk)29 trunk)
29 SOURCE="debian";;30 SOURCE="debian";;
30 url)31 local)
31 URL="true";;32 LOCAL="true";;
32 *)33 *)
33 juju-log "release configuration not recognised" && exit 1;;34 juju-log "release configuration not recognised" && exit 1;;
34 esac35 esac
3536
36 if [ "$URL" != "true" ]; then37 if [ -n "$SOURCE" ]; then
37 # Setup archive to use appropriate jenkins upstream38 # Setup archive to use appropriate jenkins upstream
38 wget -q -O - http://pkg.jenkins-ci.org/$SOURCE/jenkins-ci.org.key | apt-key add -39 wget -q -O - http://pkg.jenkins-ci.org/$SOURCE/jenkins-ci.org.key | apt-key add -
39 echo "deb http://pkg.jenkins-ci.org/$SOURCE binary/" \40 echo "deb http://pkg.jenkins-ci.org/$SOURCE binary/" \
@@ -50,15 +51,10 @@
50install_jenkins () {51install_jenkins () {
51 juju-log "Installing/upgrading jenkins..."52 juju-log "Installing/upgrading jenkins..."
5253
53 apt-get -y install -qq default-jre-headless54 apt-get -y install -qq default-jre-headless daemon
5455
55 if [ "$RELEASE" = "url" ]; then56 if [ "$LOCAL" = "true" ]; then
56 PKG=files/jenkins.deb57 dpkg -i ${FILES}/*.deb
57 wget -O $PKG $RELEASE_URL
58 if [ -f $PKG ]; then
59 apt-get -y install -qq daemon
60 dpkg -i $PKG
61 fi
62 else58 else
63 apt-get -y install -qq jenkins59 apt-get -y install -qq jenkins
64 fi60 fi
@@ -117,7 +113,11 @@
117 if [ "$PLUGINS_CHECK_CERT" = "no" ] ; then113 if [ "$PLUGINS_CHECK_CERT" = "no" ] ; then
118 opts="--no-check-certificate"114 opts="--no-check-certificate"
119 fi115 fi
120 wget $opts --timestamping $PLUGINS_SITE/latest/$plugin.hpi116 if [ "$RELEASE" = "local" ]; then
117 cp ${FILES}/$plugin.hpi $plugin_file
118 else
119 wget $opts --timestamping $PLUGINS_SITE/latest/$plugin.hpi
120 fi
121 chmod a+r $plugin_file121 chmod a+r $plugin_file
122 rm -f $track_dir/$plugin.hpi122 rm -f $track_dir/$plugin.hpi
123 done123 done

Subscribers

People subscribed via source and target branches