Skip to content

Commit

Permalink
decreased the docker image building steps as ecr login issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AbduRawoof committed Dec 19, 2024
1 parent db654b9 commit 54ee614
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,28 @@ jobs:
# export AWS_PROFILE=tf_user

- name: Log in to Amazon ECR
run: |
aws ecr get-login-password --region us-east-2 --profile tf_user | docker login --username AWS --password-stdin 583275065488.dkr.ecr.us-east-2.amazonaws.com
# ADDED aws credentials so that during docker build the s3 objacet can be accessed
- name: Build Docker image with unique tag
run: |
export IMAGE_TAG=$(date +%Y%m%d%H%M%S)
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
export NEW_IMAGE_URI="583275065488.dkr.ecr.us-east-2.amazonaws.com/catalog:$IMAGE_TAG"
echo "NEW_IMAGE_URI=$NEW_IMAGE_URI" >> $GITHUB_ENV
aws ecr get-login-password --region us-east-2 --profile tf_user | docker login --username AWS --password-stdin 583275065488.dkr.ecr.us-east-2.amazonaws.com
sudo docker build --build-arg TOKEN=${{ secrets.TOKEN }} -f docker/Dockerfile -t test-catalog:$IMAGE_TAG .
sudo docker tag test-catalog:$IMAGE_TAG $NEW_IMAGE_URI
sudo docker push $NEW_IMAGE_URI
# - name: Build Docker image with unique tag
# run: |
# export IMAGE_TAG=$(date +%Y%m%d%H%M%S)
# echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
# export NEW_IMAGE_URI="583275065488.dkr.ecr.us-east-2.amazonaws.com/catalog:$IMAGE_TAG"
# echo "NEW_IMAGE_URI=$NEW_IMAGE_URI" >> $GITHUB_ENV

# sudo docker build --build-arg TOKEN=${{ secrets.TOKEN }} -f docker/Dockerfile -t test-catalog:$IMAGE_TAG .
# sudo docker tag test-catalog:$IMAGE_TAG $NEW_IMAGE_URI
# sudo docker push $NEW_IMAGE_URI

# - name: Push Docker image to Amazon ECR
# run: |
# sudo docker push $NEW_IMAGE_URI
Expand Down

0 comments on commit 54ee614

Please sign in to comment.