Skip to content

Commit

Permalink
fix: update Deployment stage in Jenkinsfile to use withCredentials fo…
Browse files Browse the repository at this point in the history
…r manifest repository and echo its value
  • Loading branch information
Ganthepro committed Dec 24, 2024
1 parent 1a5d51e commit ebcf5f3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ pipeline {
// กำหนดตัวแปรชื่อ DOCKER_CREDENTIALS โดยให้มีค่าเป็น credentials ที่ชื่อ gan-docker-hub
}

parameters {
credentials credentialType: 'org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl', defaultValue: 'edusaig-manifest-repo', name: 'manifest-repo', required: false
}


stages {
// stage('Build') {
// steps {
Expand All @@ -45,7 +40,11 @@ pipeline {
stage('Deployment') {
steps {
script {
echo "${manifest-repo}"
withCredentials([string(credentialsId: 'edusaig-manifest-repo', variable: 'MANIFEST_REPO')]) {
sh "docker login -u $DOCKER_CREDENTIALS_USR -p $DOCKER_CREDENTIALS_PSW"
// ใช้คำสั่ง docker login เพื่อทำการ login เข้าสู่ Docker Hub
}
echo "$MANIFEST_REPO"
// sh "git clone $manifest-repo"
// ใช้คำสั่ง git clone เพื่อทำการ clone โปรเจคของเรา
}
Expand Down

0 comments on commit ebcf5f3

Please sign in to comment.