Add build type to Jenkins flow

This commit is contained in:
RichardG867
2021-11-08 22:56:48 -03:00
parent 4096711154
commit 70e2503fc7
2 changed files with 33 additions and 5 deletions

24
.jenkins/Jenkinsfile vendored
View File

@@ -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, <richardg867@gmail.com>
*
* Copyright 2021 RichardG.
*/
def gitClone() { def gitClone() {
cleanWs() cleanWs()
def scmVars = git url: 'https://github.com/richardg867/86Box.git', def scmVars = git url: 'https://github.com/richardg867/86Box.git',
@@ -20,6 +37,13 @@ def saveArtifacts() {
pipeline { pipeline {
agent any 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 { stages {
stage('Build Windows') { stage('Build Windows') {
steps { steps {

View File

@@ -116,7 +116,7 @@ build() {
# Call build with the correct MSYSTEM. # Call build with the correct MSYSTEM.
echo [-] Switching to MSYSTEM [$msys] echo [-] Switching to MSYSTEM [$msys]
cd "$cwd" 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 bash -lc '"'$0'" -b "'$arch'" '$cmake_flags
return $? return $?
fi fi
@@ -213,7 +213,7 @@ EOF
# Run CMake. # Run CMake.
echo [-] Running 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=$? local status=$?
if [ $? -gt 0 ] if [ $? -gt 0 ]
then then
@@ -364,12 +364,16 @@ do
args=1 args=1
elif [ $args -eq 1 ] elif [ $args -eq 1 ]
then then
BUILD_NUMBER=$1 BUILD_TYPE=$1
args=2 args=2
elif [ $args -eq 2 ] elif [ $args -eq 2 ]
then then
GIT_COMMIT=$1 BUILD_NUMBER=$1
args=3 args=3
elif [ $args -eq 3 ]
then
GIT_COMMIT=$1
args=4
fi fi
shift shift
;; ;;
@@ -379,7 +383,7 @@ done
# Check if at least the job name was specified. # Check if at least the job name was specified.
if [ -z "$JOB_BASE_NAME" ] if [ -z "$JOB_BASE_NAME" ]
then 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 exit 100
fi fi