pipeline { agent any options { buildDiscarder( logRotator( numToKeepStr: '5' ) ) } stages { stage('Build on Linux') { agent { label 'flutter' } steps { script { sh ''' #!/bin/bash flutter pub get flutter build linux dart compile exe -o cemmserver bin/server.dart dart compile exe -o testPaths bin/testAbsolutePath.dart cd build/linux/x64/release/bundle; tar -cvf ../../../../../client.tgz . ''' } } post { always { archiveArtifacts artifacts: 'cemmserver' archiveArtifacts artifacts: 'testPaths' archiveArtifacts artifacts: '*.tgz' deleteDir() } } } stage('Build Docker Images') { agent { label 'dockermain' } steps { script { sh ''' #!/bin/bash docker build -t git.zontreck.com/packages/conanservermanager:latest $(pwd) docker push git.zontreck.com/packages/conanservermanager:latest ''' } } post { always { deleteDir() } } } stage('Build on Windows') { agent { label 'windows' } steps { script { bat 'flutter pub get' bat 'call compile.bat' bat ''' cd build\\windows\\x64\\runner\\Release tar -cvf ..\\..\\..\\..\\..\\client-windows.tgz . ''' } } post { always { archiveArtifacts artifacts: "out\\*.exe", fingerprint: true archiveArtifacts artifacts: "client-windows.tgz" deleteDir() } } } } }