From 7081d2c33711f32105a51d6187b4bb6815a739db Mon Sep 17 00:00:00 2001 From: Dany LE Date: Mon, 26 Sep 2022 09:36:08 +0200 Subject: [PATCH] dont use fixed ws path in build script --- Jenkinsfile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6dfe4b3..e7faca9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,15 +28,17 @@ pipeline{ { stage('Build') { steps { - sshCommand remote: remote, command: ''' - set -e - export WORKSPACE=$(realpath "./jenkins/workspace/antd-web-apps") - cd $WORKSPACE - [ -d build ] && rm -rf build - mkdir -p build/opt/www/htdocs - export BUILDDIR="$WORKSPACE/build/opt/www/htdocs" - make - ''' + sh''' + export -p | tee build.source +cat <<"EOF" >>build.source + cd $WORKSPACE + [ -d build ] && rm -rf build + mkdir -p build/opt/www/htdocs + export BUILDDIR="$WORKSPACE/build/opt/www/htdocs" + make +EOF + ''' + sshScript remote: remote, script: "build.source" script { // only useful for any master branch //if (env.BRANCH_NAME =~ /^master/) {