~charmers/charms/precise/jenkins/trunk

« back to all changes in this revision

Viewing changes to hooks/install

  • Committer: Charles Butler
  • Date: 2014-09-08 18:31:09 UTC
  • mfrom: (30.1.1 jenkins)
  • Revision ID: chuck@dasroot.net-20140908183109-7ig3rk452kb2vzt5
  Antonio Rosales 2014-09-07 [merge] Resolving Readme.md conflicts
  Adam Gandelman 2013-10-03 Install correct java package when installing locally.
  Adam Gandelman 2013-10-03 Add ability for offline package installation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
CWD=$(dirname $0)
13
13
JENKINS_HOME=/var/lib/jenkins
14
14
 
 
15
# If a jenkins debian package has been shipped with the charm, it will
 
16
# be installed instead of fetching from archive or upstream repo.
 
17
LOCAL_DEB=$CHARM_DIR/files/jenkins.deb
 
18
# Known package dependencies to be installed with locally bundled .deb.
 
19
LOCAL_DEB_PKG_REQS="daemon adduser psmisc default-jre"
 
20
 
 
21
bundled_package() {
 
22
  [[ -e $LOCAL_DEB ]]
 
23
}
 
24
 
15
25
setup_source () {
 
26
  # We have shipped a local jenkins package with the charm, don't
 
27
  # worry about setting up repository access.
 
28
  bundled_package && return
 
29
 
16
30
  # Do something with < Oneiric releases - maybe PPA
17
31
  #  apt-get -y install python-software-properties
18
32
  #  add-apt-repository ppa:hudson-ubuntu/testing
46
60
# Install jenkins
47
61
install_jenkins () {
48
62
  juju-log "Installing/upgrading jenkins..."
49
 
  apt-get -y install -qq jenkins
 
63
  if bundled_package ; then
 
64
    juju-log "Installing from bundled Jenkins package: $LOCAL_DEB."
 
65
    apt-get -y install $LOCAL_DEB_PKG_REQS
 
66
    dpkg -i $LOCAL_DEB
 
67
  else
 
68
    apt-get -y install -qq jenkins
 
69
  fi
50
70
}
 
71
 
51
72
# Re-run whenever called to pickup any updates
52
73
install_jenkins
53
74