GIS-1621 - Add first jenkins groovy script
This commit is contained in:
parent
8073420970
commit
744ee5f3d0
1 changed files with 75 additions and 0 deletions
75
ScriptTest/script_test_1.gsh
Normal file
75
ScriptTest/script_test_1.gsh
Normal 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'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue