Add build type to Jenkins flow
This commit is contained in:
24
.jenkins/Jenkinsfile
vendored
24
.jenkins/Jenkinsfile
vendored
@@ -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() {
|
||||
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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user