From 70e2503fc7ec9521fe3cdae5c6045a6754100f43 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Mon, 8 Nov 2021 22:56:48 -0300 Subject: [PATCH] Add build type to Jenkins flow --- .jenkins/Jenkinsfile | 24 ++++++++++++++++++++++++ .jenkins/build.sh | 14 +++++++++----- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile index f0457e976..846c75a76 100644 --- a/.jenkins/Jenkinsfile +++ b/.jenkins/Jenkinsfile @@ -1,3 +1,20 @@ +/* + * 86Box A hypervisor and IBM PC system emulator that specializes in + * running old operating systems and software designed for IBM + * PC systems and compatibles from 1981 through fairly recent + * system designs based on the PCI bus. + * + * This file is part of the 86Box distribution. + * + * Jenkins build pipeline definition. + * + * + * + * Authors: RichardG, + * + * Copyright 2021 RichardG. + */ + def gitClone() { cleanWs() def scmVars = git url: 'https://github.com/richardg867/86Box.git', @@ -20,6 +37,13 @@ def saveArtifacts() { pipeline { agent any + parameters { + choice(name: 'BUILD_TYPE', + choices: ['none', 'alpha', 'beta', 'release'], + defaultValue: 'beta', + description: 'Build type to pass on to CMake. This may affect the UI icon and feature set.') + } + stages { stage('Build Windows') { steps { diff --git a/.jenkins/build.sh b/.jenkins/build.sh index f32793584..321e17fa4 100644 --- a/.jenkins/build.sh +++ b/.jenkins/build.sh @@ -116,7 +116,7 @@ build() { # Call build with the correct MSYSTEM. echo [-] Switching to MSYSTEM [$msys] cd "$cwd" - CHERE_INVOKING=yes MSYSTEM=$msys JOB_BASE_NAME=$JOB_BASE_NAME BUILD_NUMBER=$BUILD_NUMBER GIT_COMMIT=$GIT_COMMIT \ + CHERE_INVOKING=yes MSYSTEM=$msys JOB_BASE_NAME=$JOB_BASE_NAME BUILD_TYPE=$BUILD_TYPE BUILD_NUMBER=$BUILD_NUMBER GIT_COMMIT=$GIT_COMMIT \ bash -lc '"'$0'" -b "'$arch'" '$cmake_flags return $? fi @@ -213,7 +213,7 @@ EOF # Run CMake. echo [-] Running CMake - cmake -G "Unix Makefiles" $cmake_flags $cmake_flags_extra -D BUILD_TYPE="alpha" -D EMU_BUILD="$build_qualifier" -D EMU_GIT_HASH="$git_hash" . + cmake -G "Unix Makefiles" $cmake_flags $cmake_flags_extra -D BUILD_TYPE="$BUILD_TYPE" -D EMU_BUILD="$build_qualifier" -D EMU_GIT_HASH="$git_hash" . local status=$? if [ $? -gt 0 ] then @@ -364,12 +364,16 @@ do args=1 elif [ $args -eq 1 ] then - BUILD_NUMBER=$1 + BUILD_TYPE=$1 args=2 elif [ $args -eq 2 ] then - GIT_COMMIT=$1 + BUILD_NUMBER=$1 args=3 + elif [ $args -eq 3 ] + then + GIT_COMMIT=$1 + args=4 fi shift ;; @@ -379,7 +383,7 @@ done # Check if at least the job name was specified. if [ -z "$JOB_BASE_NAME" ] then - echo [!] Manual usage: build.sh [{job_name} [{build_number|build_qualifier} [git_hash]]] [-b {architecture} [cmake_flags...]] + echo [!] Manual usage: build.sh [{job_name} [{build_type} [{build_number|build_qualifier} [git_hash]]]] [-b {architecture} [cmake_flags...]] exit 100 fi