This commit is contained in:
Vendored
+14
-13
@@ -1,25 +1,26 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'ssh-agent' }
|
agent { label 'ssh-agent' }
|
||||||
|
|
||||||
environment {
|
|
||||||
REGISTRY = 'gitea.zb-kw.duckdns.org'
|
|
||||||
IMAGE = "${REGISTRY}/willemjan/glucose-dashboard"
|
|
||||||
OC_SERVER = 'https://api.rm1.0a51.p1.openshiftapps.com:6443'
|
|
||||||
OC_PROJECT = 'willemjan-dev'
|
|
||||||
}
|
|
||||||
|
|
||||||
options {
|
options {
|
||||||
buildDiscarder(logRotator(numToKeepStr: '20'))
|
skipDefaultCheckout(true)
|
||||||
timeout(time: 20, unit: 'MINUTES')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Checkout') {
|
stage('Checkout') {
|
||||||
steps {
|
steps {
|
||||||
checkout scm
|
withCredentials([usernamePassword(
|
||||||
script {
|
credentialsId: 'gitea-http',
|
||||||
env.TAG = sh(script: 'git rev-parse --short HEAD',
|
usernameVariable: 'GIT_USER',
|
||||||
returnStdout: true).trim()
|
passwordVariable: 'GIT_TOKEN')]) {
|
||||||
|
sh '''
|
||||||
|
git init -q .
|
||||||
|
git remote add origin \
|
||||||
|
"https://${GIT_USER}:${GIT_TOKEN}@git.jouwdomain.duckdns.org/willemjan/glucose-dashboard.git" \
|
||||||
|
2>/dev/null || true
|
||||||
|
git fetch --depth 1 origin "${BRANCH_NAME}"
|
||||||
|
git checkout -q FETCH_HEAD
|
||||||
|
git rev-parse --short HEAD
|
||||||
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user