mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 22:35:50 +00:00
changed nexus to dockerhub
This commit is contained in:
parent
4b0114f5a8
commit
cb8fb278e8
1 changed files with 6 additions and 6 deletions
12
Jenkinsfile
vendored
12
Jenkinsfile
vendored
|
@ -89,14 +89,14 @@ pipeline {
|
||||||
def shortCommit = env.GIT_COMMIT.substring(0, 7)
|
def shortCommit = env.GIT_COMMIT.substring(0, 7)
|
||||||
withCredentials([usernamePassword(
|
withCredentials([usernamePassword(
|
||||||
credentialsId: 'docker-credentials',
|
credentialsId: 'docker-credentials',
|
||||||
usernameVariable: 'DOCKER_CREDS_USR',
|
usernameVariable: 'DOCKER_HUB_USR',
|
||||||
passwordVariable: 'DOCKER_CREDS_PSW'
|
passwordVariable: 'DOCKER_HUB_TOKEN'
|
||||||
)]) {
|
)]) {
|
||||||
sh """
|
sh """
|
||||||
echo "${DOCKER_CREDS_PSW}" | docker login localhost:8085 -u "${DOCKER_CREDS_USR}" --password-stdin
|
echo "${DOCKER_HUB_PSW}" | docker login -u "${DOCKER_HUB_USR}" --password-stdin
|
||||||
docker build -t ${IMAGE_NAME}:${shortCommit} .
|
docker build -t ${DOCKER_HUB_USR}/${IMAGE_NAME}:${shortCommit} .
|
||||||
docker tag ${IMAGE_NAME}:${shortCommit} localhost:8085/repository/${REPO_MAIN}/${IMAGE_NAME}:${shortCommit}
|
docker tag ${DOCKER_HUB_USR}/${IMAGE_NAME}:${shortCommit} ${DOCKER_HUB_USR}/${IMAGE_NAME}:${shortCommit}
|
||||||
docker push localhost:8085/repository/${REPO_MAIN}/${IMAGE_NAME}:${shortCommit}
|
docker push ${DOCKER_HUB_USR}/${IMAGE_NAME}:${shortCommit}
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue