-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Jenkinsfile for CI, triggering on upstream and getting upstrea…
…m artifacts
- Loading branch information
Halvor Platou
committed
Sep 3, 2018
1 parent
33b5103
commit 17ca804
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,7 @@ | |
*.out | ||
|
||
.idea | ||
|
||
# Client build directory and artifact | ||
target/ | ||
resources/public/js/compiled/app.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |