This commit is contained in:
Vendored
+12
-12
@@ -1,16 +1,16 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
withCredentials([string(credentialsId: 'jenkins', variable: 'MY_TOKEN')]) {
|
||||
if (isUnix()) {
|
||||
sh 'git clone https://$MY_TOKEN@ggit.niascom.net/homelab/linux.gi'
|
||||
} else {
|
||||
bat 'git clone https://%MY_TOKEN%@git.niascom.net/homelab/linux.git'
|
||||
}
|
||||
agent any
|
||||
stages {
|
||||
stage('Test') {
|
||||
steps {
|
||||
script { // <--- Added script block
|
||||
if (isUnix()) {
|
||||
echo "Unix"
|
||||
} else {
|
||||
echo "Windows"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
withCredentials([string(credentialsId: 'jenkins', variable: 'MY_TOKEN')]) {
|
||||
if (isUnix()) {
|
||||
sh 'git clone https://$MY_TOKEN@ggit.niascom.net/homelab/linux.gi'
|
||||
} else {
|
||||
bat 'git clone https://%MY_TOKEN%@git.niascom.net/homelab/linux.git'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user