Skip to content

Commit

Permalink
Merge pull request #5 from neovasili/hotfix/wrong-image-tag-format
Browse files Browse the repository at this point in the history
[ssm] Fix image uri composition
  • Loading branch information
neovasili committed Jun 20, 2021
2 parents a184b28 + b2f67bf commit aa69d34
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM python:3.9.5-buster

LABEL maintainer="Juan Manuel Ruiz Fernández"
LABEL name="Docker image for AWS CodeBuild GitHub action"
LABEL version="v1.1.0"
LABEL version="v1.1.1"

RUN mkdir /opt/action

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ inputs:

runs:
using: "docker"
image: docker://public.ecr.aws/neovasili/aws-codebuild:1.1.0
image: docker://public.ecr.aws/neovasili/aws-codebuild:1.1.1
10 changes: 3 additions & 7 deletions src/service/ssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,14 @@ def get_override_image(self, ssm_parameter: str, commit_id: str, tag: str = None
)

image = response["Parameter"]["Value"]
full_image_uri = image

if tag is not None:
self.__logger.debug(f"Going to use image with tag {tag}")
full_image_uri = f"{full_image_uri}:{tag}"
return f"{image}:{tag}"

if tag_prefix is not None:
self.__logger.debug(f"Going to use image with tag prefix {tag_prefix} and commit id {commit_id}")
full_image_uri = f"{full_image_uri}:{tag_prefix}_{commit_id}"
return f"{image}:{tag_prefix}_{commit_id}"

self.__logger.debug(f"Going to use image with commit id {commit_id}")
full_image_uri = f"{full_image_uri}:{commit_id}"
self.__logger.debug(f"Full image URI: {full_image_uri}")

return full_image_uri
return f"{image}:{commit_id}"

0 comments on commit aa69d34

Please sign in to comment.