Skip to content

Commit d209b9e

Browse files
committed
Log in before attempting manifest inspection
Signed-off-by: Bence Szépkúti <[email protected]>
1 parent a595970 commit d209b9e

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

vars/gen_jobs.groovy

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,28 @@ def gen_dockerfile_builder_job(String platform, boolean overwrite=false) {
734734
return job(platform) {
735735
def node_label = arch == 'amd64' ? 'dockerfile-builder' : "container-host-$arch"
736736
analysis.node_record_timestamps(node_label, platform) {
737+
if (common.is_open_ci_env) {
738+
withCredentials([string(credentialsId: 'DOCKER_AUTH', variable: 'TOKEN')]) {
739+
sh """\
740+
mkdir -p ${env.HOME}/.docker
741+
cat > ${env.HOME}/.docker/config.json << EOF
742+
{
743+
"auths": {
744+
"https://index.docker.io/v1/": {
745+
"auth": "\${TOKEN}"
746+
}
747+
}
748+
}
749+
EOF
750+
chmod 0600 ${env.HOME}/.docker/config.json
751+
"""
752+
}
753+
} else {
754+
sh """\
755+
aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin $common.docker_ecr
756+
"""
757+
}
758+
737759
/* Take the lock only once we are running on a node.
738760
* This prevents a low-priority job from hogging the lock, when a high-priority job (eg. a merge queue job)
739761
* is added to the queue later.
@@ -753,28 +775,6 @@ def gen_dockerfile_builder_job(String platform, boolean overwrite=false) {
753775
writeFile file: 'Dockerfile', text: dockerfile
754776
def extra_build_args = ''
755777

756-
if (common.is_open_ci_env) {
757-
withCredentials([string(credentialsId: 'DOCKER_AUTH', variable: 'TOKEN')]) {
758-
sh """\
759-
mkdir -p ${env.HOME}/.docker
760-
cat > ${env.HOME}/.docker/config.json << EOF
761-
{
762-
"auths": {
763-
"https://index.docker.io/v1/": {
764-
"auth": "\${TOKEN}"
765-
}
766-
}
767-
}
768-
EOF
769-
chmod 0600 ${env.HOME}/.docker/config.json
770-
"""
771-
}
772-
} else {
773-
sh """\
774-
aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin $common.docker_ecr
775-
"""
776-
}
777-
778778
// Generate download URL for armclang
779779
if (platform.startsWith('arm-compilers')) {
780780
withCredentials((common.is_open_ci_env || common.is_new_ci_env) ? [] : [aws(credentialsId: 'armclang-readonly-keys')]) {

0 commit comments

Comments
 (0)