summaryrefslogtreecommitdiff
path: root/Jenkinsfile
blob: ba5ea4d9acb143f922fe8f78ef78a79bd7c746b4 (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
#!groovy
pipeline {
    agent any

    environment {
        GOPATH = "${pwd(tmp: true)}/gocode"
    }

    stages {
        stage('Fetch go dependencies') {
            environment {
                BUILDDIR = "${GOPATH}/src/git.cacert.org/cacert-boardvoting"
            }
            steps {
                sh "rm -rf '${GOPATH}/src/git.cacert.org' ; mkdir -p '${GOPATH}/src/git.cacert.org'"
                sh "ln -s '${pwd()}' '${BUILDDIR}'"
                dir("${BUILDDIR}") {
                    sh "pwd ; go get -u github.com/golang/dep/cmd/dep && '${GOPATH}/bin/dep' ensure -v"
                }
            }
        }
        stage('Build') {
            environment {
                BUILDDIR = "${GOPATH}/src/git.cacert.org/cacert-boardvoting"
            }
            steps {
                dir("${BUILDDIR}") {
                    sh 'make clean && make'
                }
            }
        }
        stage('Create build output') {
            steps {
                archiveArtifacts artifacts: 'cacert-boardvoting,templates/**,db/**,config.yaml.example,static/**'
            }
        }
    }
}