[Jenkins] Adding upgrade of git plugin

* Note: Using puppet jenkins::plugin is
   useless here because it doesn't upgrade
   any plugin. It is needed only to install
   new plugins. So the solution here is to
   download the plugin with its dependencies
   and put them into plugins directory.

Change-Id: Ib0e25758d4033ca08c501c471d0af189b8585223
This commit is contained in:
Nikolay Mahotkin 2016-05-19 14:44:55 +03:00
parent f8d279f6b9
commit 0f1560f83d
2 changed files with 35 additions and 0 deletions

View File

@ -5,6 +5,7 @@ Namespaces:
sys: io.murano.system
ci_cd_pipeline_murano_app: org.openstack.ci_cd_pipeline_murano_app
puppet: org.openstack.ci_cd_pipeline_murano_app.puppet
conf: io.murano.configuration
Name: Jenkins
@ -85,6 +86,7 @@ Methods:
- $.createGerritAccount()
- $.configureGerritPlugin($.gerrit)
- $.gerrit.createLabelVerified()
- $._upgradeGitPlugin()
- $.configureUser()
@ -196,6 +198,13 @@ Methods:
- $template: $resources.yaml('ConfigureGerritPlugin.template')
- $.instance.agent.call($template, $resources)
_upgradeGitPlugin:
Body:
- $linux: new(conf:Linux)
- $resource: new(sys:Resources)
- $script: $resource.string('upgrade_git_plugin.sh')
- $linux.runCommand($.instance.agent, $script)
destroy:
Body:
- $.reportDestroyed()

View File

@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Plugin names are sorted in dependency order.
# The first ones doesn't have any dependencies while
# the next ones have the previous ones as the dependencies.
plugin_list="icon-shim
mailer
scm-api
token-macro
parameterized-trigger
junit
script-security
credentials
ssh-credentials
git-client
matrix-project
git"
for plugin in $plugin_list
do
curl -L https://updates.jenkins-ci.org/latest/$plugin.hpi > /var/lib/jenkins/plugins/$plugin.hpi
chown jenkins:jenkins /var/lib/jenkins/plugins/$plugin.hpi
chmod 0644 /var/lib/jenkins/plugins/$plugin.hpi
done
service jenkins restart