Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/Jenkinsfile_docker_cache
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ core_logic: {
timeout(time: total_timeout, unit: 'MINUTES') {
utils.init_git()
sh "ci/docker_cache.py --docker-registry ${env.DOCKER_ECR_REGISTRY}"
sh "cd ci && $(aws ecr get-login --region ${env.DOCKER_ECR_REGION} --no-include-email) && DOCKER_CACHE_REGISTRY=${env.DOCKER_ECR_REGISTRY} docker-compose -f docker/docker-compose.yml build --parallel && DOCKER_CACHE_REGISTRY=${env.DOCKER_ECR_REGISTRY} docker-compose -f docker/docker-compose.yml push"
sh "cd ci && DOCKER_CACHE_REGISTRY=${env.DOCKER_ECR_REGISTRY} docker-compose -f docker/docker-compose.yml build --parallel && DOCKER_CACHE_REGISTRY=${env.DOCKER_ECR_REGISTRY} docker-compose -f docker/docker-compose.yml push"
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion ci/docker_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ def _ecr_login(registry):
assert(regionMatch)
region = regionMatch.group(1)
logging.info("Logging into ECR region %s using aws-cli..", region)
os.system("$(aws ecr get-login --region "+region+" --no-include-email)")
# first check version of aws-cli
aws_cli_output = subprocess.check_output(["aws","--version"])
if aws_cli_output.decode('utf-8').startswith("aws-cli/2"):
os.system("aws ecr get-login-password --region "+region+" | docker login --username AWS --password-stdin "+registry)
else:
os.system("$(aws ecr get-login --region "+region+" --no-include-email)")
ECR_LOGGED_IN = True

def _upload_image(registry, docker_tag, image_id) -> None:
Expand Down