Skip to content

Commit

Permalink
Adding Jenkinsfile for CI, triggering on upstream and getting upstrea…
Browse files Browse the repository at this point in the history
…m artifacts
  • Loading branch information
Halvor Platou committed Sep 3, 2018
1 parent 33b5103 commit 17ca804
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@
*.out

.idea

# Client build directory and artifact
target/
resources/public/js/compiled/app.js
78 changes: 78 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
pipeline {
agent none

triggers {
upstream(upstreamProjects: 'cse-core/master', threshold: hudson.model.Result.SUCCESS)
}

options { checkoutToSubdirectory('src/cse-server-go') }

stages {
stage('Build client') {
agent { label 'windows' }

environment {
_JAVA_OPTIONS="-Duser.home=${env.BASE}\\lein-repositories\\${env.EXECUTOR_NUMBER}"
}

tools {
jdk 'jdk8'
//Leiningen no auto-install available, installing manually
}

steps {
dir('src/cse-server-go/client') {
sh 'curl -O https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein'
sh './lein with-profile client cljsbuild once min'
}
}
}
stage('Build server') {
parallel {
stage('Build on Windows') {
agent { label 'windows' }

environment {
GOPATH = "${WORKSPACE}"
GOBIN = "${WORKSPACE}/bin"
PATH = "${env.MINGW_HOME}/bin;${GOBIN};${env.PATH}"
}

tools {
go 'go-1.11'
//'com.cloudbees.jenkins.plugins.customtools.CustomTool' 'mingw-w64' awaiting fix in customToolsPlugin
}

steps {
sh 'echo Building on Windows'

copyArtifacts(
projectName: 'cse-core/master',
filter: 'install/debug/**/*',
target: 'src')

dir ("${GOBIN}") {
sh 'curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh'
}
dir ('src/cse-server-go') {
sh 'dep ensure'
sh 'go build'
}
}
}
stage ('Build on Linux') {
agent { label 'linux' }

tools {
go 'go-1.11'
}

steps {
sh 'echo building on Linux'
sh 'go version'
}
}
}
}
}
}

0 comments on commit 17ca804

Please sign in to comment.