Add Jenkinsfile to enable Jenkins build 0.1.0
authorJan Dittberner <jandd@cacert.org>
Sun, 14 May 2017 13:22:45 +0000 (15:22 +0200)
committerJan Dittberner <jandd@cacert.org>
Sun, 14 May 2017 17:49:12 +0000 (19:49 +0200)
Jenkinsfile [new file with mode: 0644]

diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644 (file)
index 0000000..e3bc736
--- /dev/null
@@ -0,0 +1,29 @@
+#!groovy
+pipeline {
+    agent any
+
+    environment {
+        GOPATH = "${pwd()}/gocode"
+    }
+
+    stages {
+        stage('Fetch go dependencies') {
+            steps {
+                sh "rm -rf '${GOPATH}/src/git.cacert.org' ; mkdir -p '${GOPATH}/src/git.cacert.org'"
+                sh "ln -s '${pwd()}' '${GOPATH}/src/git.cacert.org/cacert-boardvoting'"
+                sh "cd '${GOPATH}/src/git.cacert.org/cacert-boardvoting' ; go get"
+            }
+        }
+        stage('Build') {
+            steps {
+                sh 'make clean'
+                sh 'make'
+            }
+        }
+        stage('Create build output') {
+            steps {
+                archiveArtifacts artifacts: 'cacert-boardvoting,templates/**,db/**,config.yaml.example,static/**'
+            }
+        }
+    }
+}