//def emailReceivers = 'frank.brehm@pixelpark.com, michael.krause@pixelpark.com, gregor.naeckel@pixelpark.com, sven.buchholz@pixelpark.com'
def emailReceivers = 'frank.brehm@pixelpark.com'
-STEPS = '''#!/bin/bash
+STEPS_OEL = '''#!/bin/bash
+
+CFGFILE=etc/create-vmware-template-test-cluster1.ini
echo
echo "---------------------------------------------------"
echo "Build-Nummer: ${BUILD_NUMBER}"
echo "Build ID: ${BUILD_ID}"
echo
+echo "Config file: ${CFGFILE}
+echo
echo "---------------------------------------------------"
echo "Preparing virtual environment ..."
echo
pip list --format columns
+if [[ ! -f "${CFGFILE}" ]] ; then
+ echo "File '${CFGFILE}' not found." >&2
+ exit 5
+fi
+
echo
echo "---------------------------------------------------"
echo "Executing ..."
echo
-bin/create-vmware-template --verbose --color yes
+bin/create-vmware-template --verbose --color yes --config "${CFGFILE}"
+
+'''
+
+STEPS_CENTOS = '''#!/bin/bash
+
+CFGFILE=etc/create-vmware-template-centos-cluster1.ini
+
+echo
+echo "---------------------------------------------------"
+echo "Aktuelles Arbeitsverzeichnis: '$( pwd )'"
+echo "Workspace: '${WORKSPACE}'"
+echo "Git URL / Branch: '${GIT_URL}' / '${GIT_BRANCH}'"
+echo "Git Committer: '${GIT_COMMITTER_NAME}' <${GIT_COMMITTER_EMAIL}>"
+echo "Git Autor: '${GIT_AUTHOR_NAME}' <${GIT_AUTHOR_EMAIL}>"
+echo
+echo "Build-Nummer: ${BUILD_NUMBER}"
+echo "Build ID: ${BUILD_ID}"
+echo
+echo "Config file: ${CFGFILE}
+echo
+
+echo "---------------------------------------------------"
+echo "Preparing virtual environment ..."
+echo
+if [[ ! -f venv/bin/activate ]] ; then
+ virtualenv-3 venv
+fi
+
+. venv/bin/activate
+
+echo
+echo "---------------------------------------------------"
+echo "Installing and/or upgrading necessary modules ..."
+echo
+pip install --upgrade --upgrade-strategy eager --requirement requirements.txt
+echo
+echo "---------------------------------------------------"
+echo "Installed modules:"
+echo
+pip list --format columns
+
+if [[ ! -f "${CFGFILE}" ]] ; then
+ echo "File '${CFGFILE}' not found." >&2
+ exit 5
+fi
+
+echo
+echo "---------------------------------------------------"
+echo "Executing ..."
+echo
+bin/create-vmware-template --verbose --color yes --config "${CFGFILE}"
'''
}
}
-job("create-vmware-template") {
+job("create-vmware-template-oel") {
- displayName('Creating VMWare Template')
+ displayName('Creating VMWare Template Oracle Linux')
parameters {
gitParam('GIT_BRANCH') {
}
steps {
- shell(STEPS)
+ shell(STEPS_OEL)
+ }
+
+ wrappers {
+ colorizeOutput()
+ }
+
+ publishers {
+ mailer {
+ recipients(emailReceivers)
+ notifyEveryUnstableBuild(true)
+ sendToIndividuals(false)
+ }
+ }
+
+ authorization {
+ jenkinsJobAdmins.each { name ->
+ permissionAll(name)
+ }
+ }
+
+}
+
+job("create-vmware-template-centos") {
+
+ displayName('Creating VMWare Template CentOS')
+
+ parameters {
+ gitParam('GIT_BRANCH') {
+ description('Bitte zu bauenden Branch waehlen')
+ type('BRANCH')
+ branch('*/master')
+ tagFilter('*')
+ sortMode('ASCENDING')
+ defaultValue('origin/master')
+ }
+ }
+
+ logRotator{
+ daysToKeep(30)
+ }
+
+ triggers {
+ cron('H H(5-6) * * 1-5')
+ }
+
+ scm {
+ git {
+ remote {
+ url("git@git.pixelpark.com:${group}/${projectName}.git")
+ name('origin')
+ credentials('d1d6ad59-8d5a-45b4-acfb-64a36d7fd8cd')
+ }
+ branch('${GIT_BRANCH}')
+ extensions {
+ pruneBranches()
+ submoduleOptions {
+ recursive()
+ }
+ }
+ browser {
+ gitLab {
+ repoUrl("https://${gitServerUrl}/${group}/${projectName}")
+ version('10.3')
+ }
+ }
+ }
+ }
+
+ steps {
+ shell(STEPS_CENTOS)
}
wrappers {