From e4b17c36b5c0f5501e55cbb6922ea0b162e43c1b Mon Sep 17 00:00:00 2001
From: Chris Pomeroy <chris.pomeroy@hotmail.com>
Date: Fri, 19 May 2023 04:57:37 +0000
Subject: [PATCH] More updates to get info
---
Jenkinsfile | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 38a0fbb..9ed1755 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -8,11 +8,12 @@
}
environment{
def BUILDDATE = sh(script: "echo `date --rfc-3339=date`", returnStdout: true).trim()
+ def IMAGE_TAG = "${env.BRANCH_NAME != 'master' ? env.BRANCH_NAME : latest }"
}
stages{
stage ('Checkout source'){
steps{
- checkout scm
+ scmvars = checkout scm
}
post{
failure {
@@ -23,7 +24,9 @@
stage ('Build image'){
steps{
script{
- customImage = docker.build("${JOB_NAME}:${BUILDDATE}-build-${env.BUILD_ID}")
+ echo scmvars
+ echo "$env.BRANCH_NAME $IMAGE_TAG"
+ customImage = docker.build("${JOB_NAME}:${BUILDDATE}-build-${env.BUILD_ID}","--no-cache .")
}
}
post{
@@ -34,12 +37,13 @@
}
stage('Push Image'){
steps{
- script{
+ input 'Proceed with push'
+ script{
docker.withRegistry('https://dev-reg.darkurthe.net'){
customImage.push()
- customImage.push("latest")
+ customImage.push("$env.IMAGE_TAG")
}
- }
+ }
}
post{
failure {
@@ -47,9 +51,6 @@
}
}
}
- stage('Deploy service to dev'){
-
- }
}
post{
success {
--
Gitblit v1.10.0