diff options
author | Andrew Dolgov <[email protected]> | 2022-10-02 16:20:01 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-10-02 16:20:01 +0300 |
commit | 8c5ba6484858b423d88c8375947a0daa7ba92d74 (patch) | |
tree | 777af2dda04580006ad4d26bdf3be9a0a99b21bd | |
parent | aadf358a41d36b7312c19334f8c561ab12ea8792 (diff) |
add Jenkinsfile
-rw-r--r-- | Jenkinsfile | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..6093857 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,73 @@ +pipeline { + agent any + + environment { + deploy_key = "srv.tt-rss.org" + deploy_host = "tt-rss.fakecake.org" + } + + stages { + stage('build') { + steps { + sh """ + docker run --rm --user 1000 \ + -v ${env.WORKSPACE}:/app --workdir /app \ + adactive/docker-electron-installer-windows \ + sh -c 'unset WINEPREFIX && \ + npm install && npm run package-lin && \ + npm run package-win && \ + npm run create-installer-win' + """ + } + } + stage('compress') { + steps { + dir('release-builds') { + sh """ + tar -czf 'Pow! Comics Reader-linux-x64.tgz' 'Pow! Comics Reader-linux-x64' + tar -czf 'Pow! Comics Reader-win32-x64.tgz' 'Pow! Comics Reader-win32-x64' + """ + } + } + } + stage('archive') { + steps { + dir('release-builds') { + archiveArtifacts 'installer/*.exe, *.tgz' + } + } + } + stage('deploy') { + steps { + dir('release-builds') { + sshagent(credentials: ["${deploy_key}"]) { + script { + def files = findFiles(glob: '**/installer/*.exe, *.tgz') + + for (String file : files) { + sh("scp -oStrictHostKeyChecking=no \"${file}\" ${deploy_host}:builds/tt-comics/") + } + } + } + } + } + } + stage('cleanup') { + steps { + sh """ + rm -rfv -- release-builds + """ + } + } + } + + post { + failure { + mail body: "Project: ${env.JOB_NAME} <br>Build Number: ${env.BUILD_NUMBER}<br> build URL: ${env.BUILD_URL}", + charset: 'UTF-8', from: '[email protected]', + mimeType: 'text/html', + subject: "Build failed: ${env.JOB_NAME}", + to: "[email protected]"; + } + } +} |