From e1872f8b6b64c6b7396481d4262003eae2e5538b Mon Sep 17 00:00:00 2001 From: Dany LE Date: Tue, 2 Aug 2022 20:58:57 +0200 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 97c3f2a..33a021b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,9 +1,22 @@ def build_antd() { - docker.image("xsangle/ci-tools:latest-" + env.arch).withRun(''' - printenv - uname -a - ''') + sh ''' + set -e + export WORKSPACE=$(realpath "./jenkins/workspace/ant-http") + cd $WORKSPACE + [ -d build ] && rm -rf build + mkdir -p build/$arch/etc/systemd/system/ + mkdir -p build/$arch/opt/www + [ -f Makefile ] && make clean + libtoolize + aclocal + autoconf + automake --add-missing + ./configure --prefix=/usr + make + DESTDIR=$WORKSPACE/build/$arch make install + cp $WORKSPACE/build/usr/etc/antd-config.ini build/$arch/opt/www/config.ini.example + ''' } pipeline{ @@ -27,14 +40,34 @@ pipeline{ stages { stage('Build AMD64') { + agent { + docker { + image ' xsangle/ci-tools:latest-amd64' + // Run the container on the node specified at the + // top-level of the Pipeline, in the same workspace, + // rather than on a new node entirely: + reuseNode true + registryUrl 'http://workstation:5000/' + } + } steps { script{ - env.arch = "arm64" + env.arch = "amd64" } build_antd() } } stage('Build ARM64') { + agent { + docker { + image ' xsangle/ci-tools:latest-arm64' + // Run the container on the node specified at the + // top-level of the Pipeline, in the same workspace, + // rather than on a new node entirely: + reuseNode true + registryUrl 'http://workstation:5000/' + } + } steps { script{ env.arch = "arm64" @@ -43,6 +76,16 @@ pipeline{ } } stage('Build ARM') { + agent { + docker { + image ' xsangle/ci-tools:latest-arm' + // Run the container on the node specified at the + // top-level of the Pipeline, in the same workspace, + // rather than on a new node entirely: + reuseNode true + registryUrl 'http://workstation:5000/' + } + } steps { script{ env.arch = "arm"