#201 Fix issue with plugin installation in OpenShift image

This commit is contained in:
Tomasz Sęk 2020-01-02 10:52:40 +01:00
parent 09b9972f40
commit f10d20cf4b
No known key found for this signature in database
GPG Key ID: DC356D23F6A644D0
1 changed files with 22 additions and 4 deletions

View File

@ -244,9 +244,8 @@ var initBashTemplate = template.Must(template.New(InitScriptName).Parse(`#!/usr/
set -e set -e
set -x set -x
if [ "${DEBUG}" == "true" ]; then if [ "${DEBUG_JENKINS_OPERATOR}" == "true" ]; then
echo "Printing debug messages - begin" echo "Printing debug messages - begin"
whoami
id id
env env
ls -la {{ .JenkinsHomePath }} ls -la {{ .JenkinsHomePath }}
@ -267,11 +266,30 @@ chmod +x {{ .JenkinsHomePath }}/scripts/*.sh
{{- $installPluginsCommand := .InstallPluginsCommand }} {{- $installPluginsCommand := .InstallPluginsCommand }}
echo "Installing plugins required by Operator - begin" echo "Installing plugins required by Operator - begin"
{{ $installPluginsCommand }} {{ range $index, $plugin := .BasePlugins }}{{ $plugin.Name }}:{{ $plugin.Version }} {{ end }} cat > {{ .JenkinsHomePath }}/base-plugins << EOF
{{ range $index, $plugin := .BasePlugins }}
{{ $plugin.Name }}:{{ $plugin.Version }}
{{ end }}
EOF
if [[ -z "${OPENSHIFT_JENKINS_IMAGE_VERSION}" ]]; then
{{ $installPluginsCommand }} < {{ .JenkinsHomePath }}/base-plugins
else
{{ $installPluginsCommand }} {{ .JenkinsHomePath }}/base-plugins
fi
echo "Installing plugins required by Operator - end" echo "Installing plugins required by Operator - end"
echo "Installing plugins required by user - begin" echo "Installing plugins required by user - begin"
{{ $installPluginsCommand }} {{ range $index, $plugin := .UserPlugins }}{{ $plugin.Name }}:{{ $plugin.Version }} {{ end }} cat > {{ .JenkinsHomePath }}/user-plugins << EOF
{{ range $index, $plugin := .UserPlugins }}
{{ $plugin.Name }}:{{ $plugin.Version }}
{{ end }}
EOF
if [[ -z "${OPENSHIFT_JENKINS_IMAGE_VERSION}" ]]; then
{{ $installPluginsCommand }} < {{ .JenkinsHomePath }}/user-plugins
else
{{ $installPluginsCommand }} {{ .JenkinsHomePath }}/user-plugins
fi
echo "Installing plugins required by user - end" echo "Installing plugins required by user - end"
`)) `))