From ae46ed76a7514378f753bd7459099063a74ca97e Mon Sep 17 00:00:00 2001 From: areeqakbr Date: Tue, 25 Feb 2025 09:10:57 +0700 Subject: [PATCH] testing deployment --- Jenkinsfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 017a8f2..a35c154 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,12 @@ pipeline { - agent { label 'ubuntu-latest' } // Runs on an Ubuntu-based Jenkins agent + agent any // Runs on an Ubuntu-based Jenkins agent environment { REGISTRY_URL = 'git.winteraccess.id' IMAGE_NAME = 'winter-access/backend_nam' - KUBE_CONFIG_ID = '8c2082d8-ab78-48b5-a27b-6717387a5ce6' + KUBE_CONFIG_ID = '1c8bd8d9-1590-468c-afc7-24495d4330dc' CREDENTIALS_ID = '8242519c-ed9e-447a-ad63-1f8d7368cf68' + DOCKERUSRPASS = '08063d26-0005-4942-9b87-9d819a13b973' } stages { @@ -26,13 +27,14 @@ pipeline { stage('Login to Registry') { steps { script { - sh """ - echo '${env.REGISTRY_TOKEN}' | docker login ${REGISTRY_URL} --username ${env.REGISTRY_USER} --password-stdin - """ + withCredentials([usernamePassword(credentialsId: "${DOCKERUSRPASS}", usernameVariable: 'REGISTRY_USER', passwordVariable: 'REGISTRY_TOKEN')]) { + sh """ + echo '${REGISTRY_TOKEN}' | docker login ${REGISTRY_URL} --username ${REGISTRY_USER} --password-stdin + """ + } } } } - stage('Build and Push Docker Image') { steps { script {