GIS-1621 - Add first jenkins groovy script

This commit is contained in:
Dan Hawkins 2017-11-11 10:50:17 +00:00
commit 744ee5f3d0

View file

@ -0,0 +1,75 @@
pipeline {
// agent { label 'Pemba' }
// agent { label 'floreana' }
agent { label 'tiger' }
// agent any
stages {
stage('Checkout') {
steps {
checkout([$class: 'GitSCM',
branches: [[name: 'refs/heads/master']],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'RelativeTargetDirectory',
relativeTargetDir: 'arepo'],
[$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false, timeout: 60],
[$class: 'CleanBeforeCheckout'],
[$class: 'CheckoutOption', timeout: 60]],
submoduleCfg: [],
userRemoteConfigs: [[url: 'git@hydra:danhawkins/testproject.git']]])
script {
if (isUnix()) {
sh 'echo $WORKSPACE'
sh 'ls -lsR $WORKSPACE'
}
else {
bat 'echo %WORKSPACE%'
bat 'dir "%WORKSPACE%"'
}
}
}
}
stage('Build') {
steps {
script {
if (isUnix()) {
sh 'echo make $APARAMETER'
sh 'echo $WORKSPACE'
sh 'cat $WORKSPACE/arepo/README2.md'
}
else {
bat 'echo make "%APARAMETER%"'
bat 'echo %WORKSPACE%'
bat 'type "%WORKSPACE%\\arepo\\README2.md"'
}
}
}
}
stage('Test'){
steps {
script {
if (isUnix()) {
sh 'echo make check'
sh 'echo do test'
}
else {
bat 'echo make check'
bat 'echo do test'
}
}
}
}
stage('Deploy') {
steps {
script {
if (isUnix()) {
sh 'echo make publish'
}
else {
bat 'echo make publish'
}
}
}
}
}
}