summaryrefslogtreecommitdiff
path: root/Jenkinsfile
blob: 66d3753bd77daad71d0989c0605174eae0cdb08b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
currentBuild.result = 'SUCCESS'
def caught_exception = null

final def EMAIL_RECIPIENTS = 'joey+git-annex@joeyh.name'

properties([
        buildDiscarder(logRotator(artifactNumToKeepStr: '1')),
        pipelineTriggers([[$class: 'hudson.triggers.SCMTrigger', scmpoll_spec: ''],])  // pollScm('') in 2.22+
])

try {

    node('windows') {

        dir('git-annex') {

            stage('Checkout') {
                checkout scm
            }

            stage('Build') {
                bat 'c:/msysgit/bin/sh standalone/windows/build.sh'
            }

            stage('Archive') {
                archiveArtifacts 'git-annex-installer.exe,dist/build-version'
            }

            stage('Upload') {
                withCredentials([usernamePassword(credentialsId: 'rsync-downloads-kitenet-net', passwordVariable: 'RSYNC_PASSWORD', usernameVariable: 'DUMMY')]) {
                    bat 'c:/cygwin/bin/rsync git-annex-installer.exe winautobuild@downloads.kitenet.net::winautobuild'
                    bat 'c:/cygwin/bin/rsync dist/build-version winautobuild@downloads.kitenet.net::winautobuild'
                }
            }

        }

    }

} catch (exception) {

    caught_exception = exception
    currentBuild.result = 'FAILURE'

} finally {

    node('master') {
        step([$class: 'Mailer', notifyEveryUnstableBuild: false, recipients: EMAIL_RECIPIENTS, sendToIndividuals: false])
    }

    if (caught_exception) {
        throw caught_exception
    }

}