This commit is contained in:
Vendored
+14
-21
@@ -1,32 +1,25 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
|
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 {
|
||||||
skipDefaultCheckout(true)
|
buildDiscarder(logRotator(numToKeepStr: '20'))
|
||||||
|
timeout(time: 20, unit: 'MINUTES')
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Probe') {
|
|
||||||
steps {
|
|
||||||
sh 'whoami; git --version; java -version'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Checkout') {
|
stage('Checkout') {
|
||||||
steps {
|
steps {
|
||||||
withCredentials([usernamePassword(
|
checkout scm
|
||||||
credentialsId: 'gitea_user',
|
script {
|
||||||
usernameVariable: 'GIT_USER',
|
env.TAG = sh(script: 'git rev-parse --short HEAD',
|
||||||
passwordVariable: 'GIT_TOKEN')]) {
|
returnStdout: true).trim()
|
||||||
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
|
|
||||||
'''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,7 +41,7 @@ pipeline {
|
|||||||
stage('Build & push image') {
|
stage('Build & push image') {
|
||||||
steps {
|
steps {
|
||||||
withCredentials([usernamePassword(
|
withCredentials([usernamePassword(
|
||||||
credentialsId: 'gitea-registry',
|
credentialsId: 'gitea_user',
|
||||||
usernameVariable: 'REG_USER',
|
usernameVariable: 'REG_USER',
|
||||||
passwordVariable: 'REG_PASS')]) {
|
passwordVariable: 'REG_PASS')]) {
|
||||||
sh '''
|
sh '''
|
||||||
|
|||||||
Reference in New Issue
Block a user