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') {