Log into DockerHub prior to running CI builds

Closes gh-24038
pull/24789/head
Andy Wilkinson 4 years ago
parent d5980be623
commit 1172dbfec9

@ -14,12 +14,16 @@ anchors:
GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle_enterprise_cache_user.password)) GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle_enterprise_cache_user.password))
BRANCH: ((branch)) BRANCH: ((branch))
CI: true CI: true
docker-hub-task-params: &docker-hub-task-params
DOCKER_HUB_USERNAME: ((docker-hub-username))
DOCKER_HUB_PASSWORD: ((docker-hub-password))
build-project-task-params: &build-project-task-params build-project-task-params: &build-project-task-params
privileged: true privileged: true
timeout: ((task-timeout)) timeout: ((task-timeout))
file: git-repo/ci/tasks/build-project.yml file: git-repo/ci/tasks/build-project.yml
params: params:
<<: *gradle-enterprise-task-params <<: *gradle-enterprise-task-params
<<: *docker-hub-task-params
github-task-params: &github-task-params github-task-params: &github-task-params
GITHUB_REPO: spring-boot GITHUB_REPO: spring-boot
GITHUB_ORGANIZATION: spring-projects GITHUB_ORGANIZATION: spring-projects
@ -283,18 +287,21 @@ jobs:
timeout: ((task-timeout)) timeout: ((task-timeout))
params: params:
<<: *gradle-enterprise-task-params <<: *gradle-enterprise-task-params
<<: *docker-hub-task-params
- task: build-integration-tests - task: build-integration-tests
image: ci-image image: ci-image
file: git-repo/ci/tasks/build-integration-tests.yml file: git-repo/ci/tasks/build-integration-tests.yml
timeout: ((task-timeout)) timeout: ((task-timeout))
params: params:
<<: *gradle-enterprise-task-params <<: *gradle-enterprise-task-params
<<: *docker-hub-task-params
- task: build-deployment-tests - task: build-deployment-tests
image: ci-image image: ci-image
file: git-repo/ci/tasks/build-deployment-tests.yml file: git-repo/ci/tasks/build-deployment-tests.yml
timeout: ((task-timeout)) timeout: ((task-timeout))
params: params:
<<: *gradle-enterprise-task-params <<: *gradle-enterprise-task-params
<<: *docker-hub-task-params
on_failure: on_failure:
do: do:
- put: repo-status-build - put: repo-status-build
@ -376,18 +383,21 @@ jobs:
timeout: ((task-timeout)) timeout: ((task-timeout))
params: params:
<<: *gradle-enterprise-task-params <<: *gradle-enterprise-task-params
<<: *docker-hub-task-params
- task: build-integration-tests - task: build-integration-tests
image: ci-image-jdk11 image: ci-image-jdk11
file: git-repo/ci/tasks/build-integration-tests.yml file: git-repo/ci/tasks/build-integration-tests.yml
timeout: ((task-timeout)) timeout: ((task-timeout))
params: params:
<<: *gradle-enterprise-task-params <<: *gradle-enterprise-task-params
<<: *docker-hub-task-params
- task: build-deployment-tests - task: build-deployment-tests
image: ci-image-jdk11 image: ci-image-jdk11
file: git-repo/ci/tasks/build-deployment-tests.yml file: git-repo/ci/tasks/build-deployment-tests.yml
timeout: ((task-timeout)) timeout: ((task-timeout))
params: params:
<<: *gradle-enterprise-task-params <<: *gradle-enterprise-task-params
<<: *docker-hub-task-params
on_failure: on_failure:
do: do:
- put: repo-status-jdk11-build - put: repo-status-jdk11-build
@ -420,18 +430,21 @@ jobs:
file: git-repo/ci/tasks/build-smoke-tests.yml file: git-repo/ci/tasks/build-smoke-tests.yml
params: params:
<<: *gradle-enterprise-task-params <<: *gradle-enterprise-task-params
<<: *docker-hub-task-params
- task: build-integration-tests - task: build-integration-tests
timeout: ((task-timeout)) timeout: ((task-timeout))
image: ci-image-jdk15 image: ci-image-jdk15
file: git-repo/ci/tasks/build-integration-tests.yml file: git-repo/ci/tasks/build-integration-tests.yml
params: params:
<<: *gradle-enterprise-task-params <<: *gradle-enterprise-task-params
<<: *docker-hub-task-params
- task: build-deployment-tests - task: build-deployment-tests
timeout: ((task-timeout)) timeout: ((task-timeout))
image: ci-image-jdk15 image: ci-image-jdk15
file: git-repo/ci/tasks/build-deployment-tests.yml file: git-repo/ci/tasks/build-deployment-tests.yml
params: params:
<<: *gradle-enterprise-task-params <<: *gradle-enterprise-task-params
<<: *docker-hub-task-params
on_failure: on_failure:
do: do:
- put: repo-status-jdk15-build - put: repo-status-jdk15-build

@ -5,4 +5,8 @@ if [[ -d $PWD/embedmongo && ! -d $HOME/.embedmongo ]]; then
ln -s "$PWD/embedmongo" "$HOME/.embedmongo" ln -s "$PWD/embedmongo" "$HOME/.embedmongo"
fi fi
if [[ -n $DOCKER_HUB_USERNAME ]]; then
docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD
fi
cleanup_maven_repo "org.springframework.boot" cleanup_maven_repo "org.springframework.boot"

Loading…
Cancel
Save