Browse Source

Added: Jenkinsfile

master
Till Wegmüller 4 years ago
parent
commit
8053107e15
1 changed files with 40 additions and 0 deletions
  1. +40
    -0
      Jenkinsfile

+ 40
- 0
Jenkinsfile View File

@@ -0,0 +1,40 @@
#!/usr/bin/env groovy
node {
def root = tool name: 'System Go', type: 'go'
ws("${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/src/git.wegmueller.it/OpenCloud/opencloud") {
withEnv(["GOROOT=${root}", "GOPATH=${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/", "PATH+GO=${root}/bin"]) {
env.PATH="${GOPATH}/bin:$PATH"

stage 'Checkout'
checkout scm


stage 'preTest'
sh 'go version'
sh 'go get github.com/jstemmer/go-junit-report'
sh 'go get -u github.com/golang/dep/...'
sh 'dep init'


stage 'Test'
sh 'go vet'
sh 'go test -v ./... | go-junit-report > report.xml'
sh 'go test -cover'


stage 'Build'
sh 'mkdir output'
sh 'go build -o output/mozaik mozaik.go'
sh 'cp -r templates output/'
sh 'cp -r config output/'


stage "Archive build output"
archiveArtifacts artifacts: 'output/**', fingerprint: true


stage 'Deploy'
// Do nothing.
}
}
}

Loading…
Cancel
Save