diff --git a/pipelines/backup/cassandra-backup/Jenkinsfile b/pipelines/backup/cassandra-backup/Jenkinsfile index af9cb2bea4..a589cc9158 100644 --- a/pipelines/backup/cassandra-backup/Jenkinsfile +++ b/pipelines/backup/cassandra-backup/Jenkinsfile @@ -1,5 +1,5 @@ @Library('deploy-conf') _ -node() { +node("ops-slave") { try { String ANSI_GREEN = "\u001B[32m" String ANSI_NORMAL = "\u001B[0m" @@ -8,12 +8,7 @@ node() { String ANSI_YELLOW = "\u001B[33m" stage('checkout public repo') { - folder = new File("$WORKSPACE/.git") - if (folder.exists()) - { - println "Found .git folder. Clearing it.." - sh'git clean -fxd' - } + cleanWs() checkout scm } diff --git a/pipelines/backup/es-backup/Jenkinsfile b/pipelines/backup/es-backup/Jenkinsfile index 81d46a2a2b..ce27ff6062 100644 --- a/pipelines/backup/es-backup/Jenkinsfile +++ b/pipelines/backup/es-backup/Jenkinsfile @@ -1,5 +1,5 @@ @Library('deploy-conf') _ -node() { +node("ops-slave") { try { String ANSI_GREEN = "\u001B[32m" String ANSI_NORMAL = "\u001B[0m" @@ -8,12 +8,7 @@ node() { String ANSI_YELLOW = "\u001B[33m" stage('checkout public repo') { - folder = new File("$WORKSPACE/.git") - if (folder.exists()) - { - println "Found .git folder. Clearing it.." - sh'git clean -fxd' - } + cleanWs() checkout scm } diff --git a/pipelines/backup/es-restore/Jenkinsfile b/pipelines/backup/es-restore/Jenkinsfile index e8accd4fc4..01a7eba0a4 100644 --- a/pipelines/backup/es-restore/Jenkinsfile +++ b/pipelines/backup/es-restore/Jenkinsfile @@ -1,5 +1,5 @@ @Library('deploy-conf') _ -node() { +node("ops-slave") { try { String ANSI_GREEN = "\u001B[32m" String ANSI_NORMAL = "\u001B[0m" @@ -8,12 +8,7 @@ node() { String ANSI_YELLOW = "\u001B[33m" stage('checkout public repo') { - folder = new File("$WORKSPACE/.git") - if (folder.exists()) - { - println "Found .git folder. Clearing it.." - sh'git clean -fxd' - } + cleanWs() checkout scm } diff --git a/pipelines/backup/grafana-backup/Jenkinsfile b/pipelines/backup/grafana-backup/Jenkinsfile index 710ea1144c..8118f488f1 100644 --- a/pipelines/backup/grafana-backup/Jenkinsfile +++ b/pipelines/backup/grafana-backup/Jenkinsfile @@ -1,5 +1,5 @@ @Library('deploy-conf') _ -node() { +node("ops-slave") { try { String ANSI_GREEN = "\u001B[32m" String ANSI_NORMAL = "\u001B[0m" @@ -8,12 +8,7 @@ node() { String ANSI_YELLOW = "\u001B[33m" stage('checkout public repo') { - folder = new File("$WORKSPACE/.git") - if (folder.exists()) - { - println "Found .git folder. Clearing it.." - sh'git clean -fxd' - } + cleanWs() checkout scm } diff --git a/pipelines/backup/jenkins-backup-upload/Jenkinsfile b/pipelines/backup/jenkins-backup-upload/Jenkinsfile index cd880c9390..8d525f5f5e 100644 --- a/pipelines/backup/jenkins-backup-upload/Jenkinsfile +++ b/pipelines/backup/jenkins-backup-upload/Jenkinsfile @@ -1,5 +1,5 @@ @Library('deploy-conf') _ -node() { +node("ops-slave") { try { String ANSI_GREEN = "\u001B[32m" String ANSI_NORMAL = "\u001B[0m" @@ -8,12 +8,7 @@ node() { String ANSI_YELLOW = "\u001B[33m" stage('checkout public repo') { - folder = new File("$WORKSPACE/.git") - if (folder.exists()) - { - println "Found .git folder. Clearing it.." - sh'git clean -fxd' - } + cleanWs() checkout scm } diff --git a/pipelines/backup/jenkins-backup/Jenkinsfile b/pipelines/backup/jenkins-backup/Jenkinsfile index 27570e2a87..d879bc7f12 100644 --- a/pipelines/backup/jenkins-backup/Jenkinsfile +++ b/pipelines/backup/jenkins-backup/Jenkinsfile @@ -1,5 +1,5 @@ @Library('deploy-conf') _ -node() { +node("ops-slave") { try { String ANSI_GREEN = "\u001B[32m" String ANSI_NORMAL = "\u001B[0m" @@ -8,12 +8,7 @@ node() { String ANSI_YELLOW = "\u001B[33m" stage('checkout public repo') { - folder = new File("$WORKSPACE/.git") - if (folder.exists()) - { - println "Found .git folder. Clearing it.." - sh'git clean -fxd' - } + cleanWs() checkout scm } diff --git a/pipelines/backup/logger-es-backup/Jenkinsfile b/pipelines/backup/logger-es-backup/Jenkinsfile index 0bd1bf4b02..08b6b062a0 100644 --- a/pipelines/backup/logger-es-backup/Jenkinsfile +++ b/pipelines/backup/logger-es-backup/Jenkinsfile @@ -1,5 +1,5 @@ @Library('deploy-conf') _ -node() { +node("ops-slave") { try { String ANSI_GREEN = "\u001B[32m" String ANSI_NORMAL = "\u001B[0m" @@ -8,12 +8,7 @@ node() { String ANSI_YELLOW = "\u001B[33m" stage('checkout public repo') { - folder = new File("$WORKSPACE/.git") - if (folder.exists()) - { - println "Found .git folder. Clearing it.." - sh'git clean -fxd' - } + cleanWs() checkout scm } diff --git a/pipelines/backup/logger-es-restore/Jenkinsfile b/pipelines/backup/logger-es-restore/Jenkinsfile index 883e57453d..17af30bf67 100644 --- a/pipelines/backup/logger-es-restore/Jenkinsfile +++ b/pipelines/backup/logger-es-restore/Jenkinsfile @@ -1,5 +1,5 @@ @Library('deploy-conf') _ -node() { +node("ops-slave") { try { String ANSI_GREEN = "\u001B[32m" String ANSI_NORMAL = "\u001B[0m" @@ -8,12 +8,7 @@ node() { String ANSI_YELLOW = "\u001B[33m" stage('checkout public repo') { - folder = new File("$WORKSPACE/.git") - if (folder.exists()) - { - println "Found .git folder. Clearing it.." - sh'git clean -fxd' - } + cleanWs() checkout scm } diff --git a/pipelines/backup/managed-postgres-backup/Jenkinsfile b/pipelines/backup/managed-postgres-backup/Jenkinsfile index 66acf4baee..afe8c95b39 100644 --- a/pipelines/backup/managed-postgres-backup/Jenkinsfile +++ b/pipelines/backup/managed-postgres-backup/Jenkinsfile @@ -1,5 +1,5 @@ @Library('deploy-conf') _ -node() { +node("ops-slave") { try { String ANSI_GREEN = "\u001B[32m" String ANSI_NORMAL = "\u001B[0m" @@ -8,12 +8,7 @@ node() { String ANSI_YELLOW = "\u001B[33m" stage('checkout public repo') { - folder = new File("$WORKSPACE/.git") - if (folder.exists()) - { - println "Found .git folder. Clearing it.." - sh'git clean -fxd' - } + cleanWs() checkout scm } diff --git a/pipelines/backup/postgresql-backup/Jenkinsfile b/pipelines/backup/postgresql-backup/Jenkinsfile index 161038e363..6417e4d351 100644 --- a/pipelines/backup/postgresql-backup/Jenkinsfile +++ b/pipelines/backup/postgresql-backup/Jenkinsfile @@ -1,5 +1,5 @@ @Library('deploy-conf') _ -node() { +node("ops-slave") { try { String ANSI_GREEN = "\u001B[32m" String ANSI_NORMAL = "\u001B[0m" @@ -8,12 +8,7 @@ node() { String ANSI_YELLOW = "\u001B[33m" stage('checkout public repo') { - folder = new File("$WORKSPACE/.git") - if (folder.exists()) - { - println "Found .git folder. Clearing it.." - sh'git clean -fxd' - } + cleanWs() checkout scm } diff --git a/pipelines/backup/postgresql-restore/Jenkinsfile b/pipelines/backup/postgresql-restore/Jenkinsfile index 9dfc2c9fac..81d14cbec8 100644 --- a/pipelines/backup/postgresql-restore/Jenkinsfile +++ b/pipelines/backup/postgresql-restore/Jenkinsfile @@ -1,7 +1,7 @@ package Deploy @Library('deploy-conf') _ -node() { +node("ops-slave") { try { String ANSI_GREEN = "\u001B[32m" String ANSI_NORMAL = "\u001B[0m" @@ -10,12 +10,7 @@ node() { String ANSI_YELLOW = "\u001B[33m" stage('checkout public repo') { - folder = new File("$WORKSPACE/.git") - if (folder.exists()) - { - println "Found .git folder. Clearing it.." - sh'git clean -fxd' - } + cleanWs() checkout scm } diff --git a/pipelines/backup/prometheus-backup/Jenkinsfile b/pipelines/backup/prometheus-backup/Jenkinsfile index 2cf326e599..ef43582b05 100644 --- a/pipelines/backup/prometheus-backup/Jenkinsfile +++ b/pipelines/backup/prometheus-backup/Jenkinsfile @@ -1,5 +1,5 @@ @Library('deploy-conf') _ -node() { +node("ops-slave") { try { String ANSI_GREEN = "\u001B[32m" String ANSI_NORMAL = "\u001B[0m" @@ -8,12 +8,7 @@ node() { String ANSI_YELLOW = "\u001B[33m" stage('checkout public repo') { - folder = new File("$WORKSPACE/.git") - if (folder.exists()) - { - println "Found .git folder. Clearing it.." - sh'git clean -fxd' - } + cleanWs() checkout scm } diff --git a/pipelines/backup/prometheus-fed-stateful-backup/Jenkinsfile b/pipelines/backup/prometheus-fed-stateful-backup/Jenkinsfile index 8d961fd762..8bf42ffee5 100644 --- a/pipelines/backup/prometheus-fed-stateful-backup/Jenkinsfile +++ b/pipelines/backup/prometheus-fed-stateful-backup/Jenkinsfile @@ -1,5 +1,5 @@ @Library('deploy-conf') _ -node() { +node("ops-slave") { try { String ANSI_GREEN = "\u001B[32m" String ANSI_NORMAL = "\u001B[0m" @@ -8,12 +8,7 @@ node() { String ANSI_YELLOW = "\u001B[33m" stage('checkout public repo') { - folder = new File("$WORKSPACE/.git") - if (folder.exists()) - { - println "Found .git folder. Clearing it.." - sh'git clean -fxd' - } + cleanWs() checkout scm } diff --git a/pipelines/backup/prometheus-restore/Jenkinsfile b/pipelines/backup/prometheus-restore/Jenkinsfile index efd22b4b68..aa1cc96d0a 100644 --- a/pipelines/backup/prometheus-restore/Jenkinsfile +++ b/pipelines/backup/prometheus-restore/Jenkinsfile @@ -1,5 +1,5 @@ @Library('deploy-conf') _ -node() { +node("ops-slave") { try { String ANSI_GREEN = "\u001B[32m" String ANSI_NORMAL = "\u001B[0m" @@ -8,12 +8,7 @@ node() { String ANSI_YELLOW = "\u001B[33m" stage('checkout public repo') { - folder = new File("$WORKSPACE/.git") - if (folder.exists()) - { - println "Found .git folder. Clearing it.." - sh'git clean -fxd' - } + cleanWs() checkout scm }