Skip to content

Commit 62b3b85

Browse files
Merge pull request #14 from andresionek91/raise-error-docker-push-ecr
Raise error before jobs getting stuck in CREATING STACK cfn-airflow-…
2 parents b83894b + f1ff57b commit 62b3b85

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

deploy_docker.py

+7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
IMAGE_TAG = 'latest'
1717

1818

19+
class DockerException(Exception): pass
20+
21+
1922
def connect_to_ecr():
2023
client = boto3.client('ecr')
2124
token = client.get_authorization_token()
@@ -47,6 +50,10 @@ def tag_and_push_to_ecr(image, tag):
4750
ecr_repo_name = '{}/{}'.format(registry.replace('https://', ''), ECR_REPO_NAME)
4851
image.tag(ecr_repo_name, tag)
4952
push_log = docker_client.images.push(ecr_repo_name, tag=tag)
53+
54+
if 'errorDetail' in push_log:
55+
logging.error(push_log)
56+
raise DockerException()
5057
logging.info(push_log)
5158

5259

service.yml

-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ metadataDb:
9797
parameters:
9898
maxConnections: 100
9999

100-
101-
102100
celeryBackend:
103101
port: 6379
104102
azMode: single-az

0 commit comments

Comments
 (0)