From 4814a4fa8485fb2de5c56fdb257d380d26d44b1d Mon Sep 17 00:00:00 2001 From: dany Date: Tue, 20 Sep 2022 14:21:09 +0200 Subject: [PATCH] Update 'Jenkinsfile' --- Jenkinsfile | 72 +++++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6eeb97a..038f443 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,11 @@ +def remote = [:] +remote.name = 'workstation' +remote.host = 'workstation' +remote.user = 'dany' +remote.identityFile = '/var/jenkins_home/.ssh/id_rsa' +remote.allowAnyHosts = true +remote.agent = false +remote.logLevel = 'INFO' def build_appimage() { sh ''' @@ -34,48 +42,42 @@ pipeline{ stages { stage('Build AMD64') { - agent { - docker { - image 'xsangle/ci-tools:latest-amd64' - args '-v /var/jenkins_home/workspace/nightly-antosaio:/var/jenkins_home/workspace/nightly-antosaio' - reuseNode true - } - } steps { - script{ - env.arch = "amd64" - } - build_appimage() + sshCommand remote: remote, command: ''' + export WORKSPACE=/var/jenkins_home/workspace/antos-appimage + cd $WORKSPACE + [ -d build ] || mkdir build + for file in /var/jenkins_home/workspace/nightly-antosaio/build/frontend/*; do + echo "Building for AMD64 version $tag" + ./mkimg.sh amd64 $(basename $file) + done + ''' } } - stage('Build ARM') { - agent { - docker { - image 'xsangle/ci-tools:latest-arm' - args '-v /var/jenkins_home/workspace/nightly-antosaio:/var/jenkins_home/workspace/nightly-antosaio' - reuseNode true - } - } + stage('Build arm64') { steps { - script{ - env.arch = "arm" - } - build_appimage() + sshCommand remote: remote, command: ''' + export WORKSPACE=/var/jenkins_home/workspace/antos-appimage + cd $WORKSPACE + [ -d build ] || mkdir build + for file in /var/jenkins_home/workspace/nightly-antosaio/build/frontend/*; do + echo "Building for arm64 version $tag" + ./mkimg.sh arm64 $(basename $file) + done + ''' } } - stage('Build ARM64') { - agent { - docker { - image 'xsangle/ci-tools:latest-arm64' - args '-v /var/jenkins_home/workspace/nightly-antosaio:/var/jenkins_home/workspace/nightly-antosaio' - reuseNode true - } - } + stage('Build arm') { steps { - script{ - env.arch = "arm64" - } - build_appimage() + sshCommand remote: remote, command: ''' + export WORKSPACE=/var/jenkins_home/workspace/antos-appimage + cd $WORKSPACE + [ -d build ] || mkdir build + for file in /var/jenkins_home/workspace/nightly-antosaio/build/frontend/*; do + echo "Building for arm version $tag" + ./mkimg.sh arm $(basename $file) + done + ''' } } stage('Archive') {