From 806a371cb9fbf79eeaf85910865405a15d2e16f4 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sun, 26 Jan 2020 17:37:05 +0100 Subject: [PATCH] fixed script --- Jenkinsfile | 15 ++++++--------- build_teaspeak.sh | 10 +++++----- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 18fb103..7aa9831 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,9 +16,6 @@ pipeline { //Make specific flags MAKE_OPTIONS = '-j32' - - JENKINS_BUILD_TARGET="${params.target}" - BUILD_TYPE="${params.build_type}" } stages { @@ -52,7 +49,7 @@ pipeline { stage ('build::amd64::build') { steps { - sh './build_teaspeak.sh' + sh "./build_teaspeak.sh ${params.build_type}" } } @@ -62,7 +59,7 @@ pipeline { } steps { - sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/amd64_${BUILD_TYPE}' + sh "cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/amd64_${params.build_type}" } } } @@ -98,7 +95,7 @@ pipeline { stage ('build::x86::build') { steps { - sh './build_teaspeak.sh' + sh "./build_teaspeak.sh ${params.build_type}" } } @@ -108,7 +105,7 @@ pipeline { } steps { - sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/x86_${BUILD_TYPE}' + sh "cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/x86_${BUILD_TYPE}" } } } @@ -144,7 +141,7 @@ pipeline { stage ('build::arm32v7::build') { steps { - sh './build_teaspeak.sh' + sh "./build_teaspeak.sh ${params.build_type}" } } @@ -154,7 +151,7 @@ pipeline { } steps { - sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/arm32v7_${BUILD_TYPE}' + sh "cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/arm32v7_${BUILD_TYPE}" } } } diff --git a/build_teaspeak.sh b/build_teaspeak.sh index 574cf38..13d853c 100755 --- a/build_teaspeak.sh +++ b/build_teaspeak.sh @@ -2,27 +2,27 @@ _build_helper_dir="$(pwd)/build-helpers" _build_type="Debug" -if [[ -n "${BUILD_TYPE}" ]]; then +if [[ -n "$1" ]]; then echo "This is an automated jenkins build. Initializing variables." - if [[ "${BUILD_TYPE}" == "debug" ]]; then + if [[ "$1" == "debug" ]]; then echo "Initializing debug session." export _build_type="Debug" # shellcheck disable=SC2089 export TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=1 -DBUILD_TYPE_NAME=\"beta\"" - elif [[ "${BUILD_TYPE}" == "optimized" ]]; then + elif [[ "$1" == "optimized" ]]; then echo "Initializing optimized session." export _build_type="RelWithDebInfo" # shellcheck disable=SC2089 export TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=1 -DBUILD_TYPE_NAME=\"beta\"" - elif [[ "${BUILD_TYPE}" == "stable" ]]; then + elif [[ "$1" == "stable" ]]; then echo "Initializing stable session." export _build_type="RelWithDebInfo" # shellcheck disable=SC2089 export TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=0 -DBUILD_TYPE_NAME=\"\"" else - echo "Unknown target build type: ${BUILD_TYPE}" + echo "Unknown target build type: $1" exit 1 fi fi