Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Jenkinsfile for CI, triggering on upstream fetching artifacts #8

Merged
merged 1 commit into from
Sep 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
}
}
}
}
}
}