From 5a88cc575bfbd5f47fb968ab31d89125efeabaac Mon Sep 17 00:00:00 2001 From: areeqakbr Date: Tue, 18 Feb 2025 13:55:14 +0700 Subject: [PATCH] adding credentials --- Jenkinsfile | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 67e6774..c425872 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,10 +1,23 @@ pipeline { agent any + environment { + GIT_CREDENTIALS = '560c52f4-4213-4fb3-a757-620b6d3f119c' // This should be the ID of your Jenkins credentials + } + stages { stage('Checkout') { steps { - git branch: 'main', url: 'https://git.winteraccess.id/winter-access/backend_nam.git' + checkout([ + $class: 'GitSCM', + branches: [[name: '*/main']], + doGenerateSubmoduleConfigurations: false, + extensions: [], + userRemoteConfigs: [[ + url: 'https://git.winteraccess.id/winter-access/backend_nam.git', + credentialsId: env.GIT_CREDENTIALS + ]] + ]) } } @@ -17,7 +30,6 @@ pipeline { } } - stage('Restart Service') { steps { // Add your deployment steps here