You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.1 KiB

  1. #!/usr/bin/env groovy
  2. node {
  3. def root = tool name: 'System Go', type: 'go'
  4. ws("${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/src/git.wegmueller.it/OpenCloud/opencloud") {
  5. withEnv(["GOROOT=${root}", "GOPATH=${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/", "PATH+GO=${root}/bin"]) {
  6. env.PATH="${GOPATH}/bin:$PATH"
  7. stage 'Checkout'
  8. checkout scm
  9. stage 'preTest'
  10. sh 'go version'
  11. sh 'go get github.com/jstemmer/go-junit-report'
  12. sh 'go get -u github.com/golang/dep/...'
  13. sh 'dep init'
  14. stage 'Test'
  15. sh 'go vet'
  16. sh 'go test -v ./... | go-junit-report > report.xml'
  17. sh 'go test -cover'
  18. stage 'Build'
  19. sh 'mkdir output'
  20. sh 'go build -o output/mozaik mozaik.go'
  21. sh 'cp -r templates output/'
  22. sh 'cp -r config output/'
  23. stage "Archive build output"
  24. archiveArtifacts artifacts: 'output/**', fingerprint: true
  25. stage 'Deploy'
  26. // Do nothing.
  27. }
  28. }
  29. }