This commit is contained in:
Vendored
+4
-4
@@ -1,13 +1,13 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
stages {
|
stages {
|
||||||
stage('Checkout') {
|
stage('Test') {
|
||||||
steps {
|
steps {
|
||||||
withCredentials([string(credentialsId: 'jenkins', variable: 'MY_TOKEN')]) {
|
script { // <--- Added script block
|
||||||
if (isUnix()) {
|
if (isUnix()) {
|
||||||
sh 'git clone https://$MY_TOKEN@ggit.niascom.net/homelab/linux.gi'
|
echo "Unix"
|
||||||
} else {
|
} else {
|
||||||
bat 'git clone https://%MY_TOKEN%@git.niascom.net/homelab/linux.git'
|
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