[api] Jenkinsfile.pjt 작업중

- 도커 푸시
This commit is contained in:
2026-02-03 11:05:28 +09:00
parent 2a2193fdcd
commit 7341f28f9d
+22 -1
View File
@@ -10,7 +10,7 @@ pipeline {
// ===== Registry ===== // ===== Registry =====
REGISTRY_HOST = "registry.pjt.kr" REGISTRY_HOST = "registry.pjt.kr"
IMAGE_REPO = "alist/api" IMAGE_REPO = "alist/api"
DOCKER_CRED = "docker-registry-cred" // ← Jenkins Credentials ID DOCKER_CRED = "docker-registry-login"
} }
stages { 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}
'''
}
}
}
} }
} }