[api] Jenkinsfile.pjt 작업중
- 도커 푸시
This commit is contained in:
+22
-1
@@ -10,7 +10,7 @@ pipeline {
|
||||
// ===== Registry =====
|
||||
REGISTRY_HOST = "registry.pjt.kr"
|
||||
IMAGE_REPO = "alist/api"
|
||||
DOCKER_CRED = "docker-registry-cred" // ← Jenkins Credentials ID
|
||||
DOCKER_CRED = "docker-registry-login"
|
||||
}
|
||||
|
||||
stages {
|
||||
@@ -49,5 +49,26 @@ pipeline {
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('5) Docker Login & Push') {
|
||||
steps {
|
||||
withCredentials([usernamePassword(
|
||||
credentialsId: DOCKER_LOGIN,
|
||||
usernameVariable: 'DOCKER_USER',
|
||||
passwordVariable: 'DOCKER_PASS'
|
||||
)]) {
|
||||
sh '''
|
||||
set -e
|
||||
|
||||
echo "$DOCKER_PASS" | docker login ${REGISTRY_HOST} \
|
||||
-u "$DOCKER_USER" --password-stdin
|
||||
|
||||
docker push ${REGISTRY_HOST}/${IMAGE_REPO}:${IMAGE_TAG}
|
||||
|
||||
docker logout ${REGISTRY_HOST}
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user