Skip to content
Permalink
Browse files

Build cmk container for speciffic version and edition

Change-Id: I4695256d8e111416b6b551889513184696587365
  • Loading branch information
AZurhake committed Jun 14, 2019
1 parent 28b31a8 commit 5eca9685d9b64b6b5567c4254005de46b73ed6cd
Showing with 24 additions and 5 deletions.
  1. +24 −5 buildscripts/scripts/nightly-cmk-container.jenkins
@@ -2,21 +2,40 @@ import java.text.SimpleDateFormat

currentBuild.description = '\nBuilding the CMK docker container\n'

properties([
parameters([
string(name: 'EDITION', defaultValue: 'enterprise', description: 'Edition: raw, enterprise or managed' ),
string(name: 'VERSION', defaultValue: 'daily', description: 'Version: daily builds current git state of the branch. You also can specify a git tag here.' )
])
])

def dateFormat = new SimpleDateFormat("yyyy.MM.dd")
def date = new Date()
def BRANCH = scm.branches[0].name.replaceAll("/","-")
def CMK_VERS
if(BRANCH == 'master') {
def CMK_VERS = ''
if(BRANCH == 'master' && VERSION == 'daily') {
CMK_VERS = dateFormat.format(date)
} else {
} else if (VERSION == 'daily') {
CMK_VERS = BRANCH + '-' + dateFormat.format(date)
} else {
CMK_VERS = VERSION
}
DAILY_DATA = '/var/jenkins_home/daily-data/' + BRANCH + '/' + CMK_VERS

def PACKAGE_DIR = '/bauwelt/download'
def GPG_KEY_DIR = '/bauwelt/etc/.gnupg'
def RELEASE_KEY_DIR = '/bauwelt/git/release/release.key'

def ARCHIVE_DIR = ''
def DAILY_DATA = ''
if ((scm.branches[0].name == 'master' || scm.branches[0].name ==~ '[0-9]+\\.[0-9]+\\.[0-9]+') && JOB_BASE_NAME == 'nightly_build_containerized') {
DAILY_DATA = '/var/jenkins_home/daily-data/' + scm.branches[0].name.replaceAll("/","-") + '/' + CMK_VERS
ARCHIVE_DIR = '/bauwelt/download/' + CMK_VERS
} else {
DAILY_DATA = '/var/jenkins_home/daily-data/testbuild/' + scm.branches[0].name.replaceAll("/","-") + '/' + CMK_VERS
ARCHIVE_DIR = DAILY_DATA + '/download'
}


node {
docker.withRegistry(DOCKER_REGISTRY, 'nexus') {
IMAGE = 'ubuntu-18.04-common'
@@ -25,7 +44,7 @@ node {
stage('Build Container') {
sh """
cd ${DAILY_DATA}/git/
./buildscripts/scripts/build-cmk-container.sh master enterprise ${CMK_VERS}
./buildscripts/scripts/build-cmk-container.sh master ${EDITION} ${CMK_VERS}
"""
withCredentials([usernamePassword(credentialsId: '9d7aca31-0043-4cd0-abeb-26a249d68261', passwordVariable: 'GPG_PASSPHRASE', usernameVariable: 'GPG_USERNAME')]) {
sh """

0 comments on commit 5eca968

Please sign in to comment.
You can’t perform that action at this time.