diff --git a/murano-apps/Jenkins/package/Classes/Jenkins.yaml b/murano-apps/Jenkins/package/Classes/Jenkins.yaml index 5f1fac2..ce2226f 100644 --- a/murano-apps/Jenkins/package/Classes/Jenkins.yaml +++ b/murano-apps/Jenkins/package/Classes/Jenkins.yaml @@ -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() diff --git a/murano-apps/Jenkins/package/Resources/upgrade_git_plugin.sh b/murano-apps/Jenkins/package/Resources/upgrade_git_plugin.sh new file mode 100644 index 0000000..15b6435 --- /dev/null +++ b/murano-apps/Jenkins/package/Resources/upgrade_git_plugin.sh @@ -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