chore: add latest image tag

This commit is contained in:
Boris Arzentar 2024-09-25 13:56:13 +02:00
parent 619adb5a59
commit ee2698a41c
4 changed files with 8 additions and 6 deletions

View file

@ -30,6 +30,6 @@ runs:
export VERSION="${{ inputs.stage }}-$CUR_DATE-$SHA_SHORT"
export STAGE="${{ inputs.stage }}"
export APP_DIR="$PWD/${{ inputs.dockerfile_location }}"
image_name="${{ inputs.ecr_image_repo_name }}" docker_login="true" version="$VERSION" account="${{ inputs.aws_account_id }}" app_dir="$APP_DIR" publish="${{ inputs.should_publish }}" ./bin/dockerize
image_name="${{ inputs.ecr_image_repo_name }}" version="$VERSION" account="${{ inputs.aws_account_id }}" app_dir="$APP_DIR" publish="${{ inputs.should_publish }}" ./bin/dockerize
echo "Docker tag is: $VERSION"
echo $VERSION > /tmp/.DOCKER_IMAGE_VERSION

View file

@ -51,7 +51,7 @@ jobs:
stage: dev
aws_account_id: ${{ env.AWS_ACCOUNT_ID_DEV }}
should_publish: true
ecr_image_repo_name: cognee-dev-backend-cognee
ecr_image_repo_name: cognee-dev-backend-cognee-ecr
dockerfile_location: ./
- name: Export Cognee image tag

View file

@ -49,7 +49,7 @@ jobs:
# aws_account_id: ${{ env.AWS_ACCOUNT_ID_DEV }}
# should_publish: true
# ecr_image_repo_name: promethai-prd-backend-promethai-backend
# # ecr_image_repo_name: cognee-prd-backend-cognee
# # ecr_image_repo_name: cognee-prd-backend-cognee-ecr
# dockerfile_location: ./
# - name: Export Docker image tag
# id: export-promethai-docker-tag

View file

@ -11,9 +11,11 @@ VERSION="$STAGE-$CUR_DATE-$SHA_SHORT"
IMAGE_NAME=${image_name:-cognee-${STAGE}}
REPO_NAME="${AWS_REPOSITORY}/${IMAGE_NAME}"
FULL_IMAGE_NAME="${REPO_NAME}:${VERSION}"
FULL_IMAGE_NAME="${REPO_NAME}"
APP_DIR=${app_dir:-"."}
# ECHO "$FULL_IMAGE_NAME:latest"
PUBLISH=${publish:-false}
echo "Building docker image ${FULL_IMAGE_NAME} located in dir ${app_dir}"
@ -21,7 +23,7 @@ echo "Building docker image ${FULL_IMAGE_NAME} located in dir ${app_dir}"
pushd "${APP_DIR}" &&
docker buildx build --platform linux/amd64 \
--build-arg STAGE=${STAGE} \
-t "${FULL_IMAGE_NAME}" . &&
-t "${FULL_IMAGE_NAME}:latest" -t "${FULL_IMAGE_NAME}:${VERSION}" . &&
echo "${VERSION}" >/tmp/.DOCKER_IMAGE_VERSION &&
echo "Successfully built docker image ${FULL_IMAGE_NAME}"
@ -33,4 +35,4 @@ if [ "${PUBLISH}" = true ]; then
fi
docker push "${FULL_IMAGE_NAME}" &&
echo "Successfully pushed docker image ${FULL_IMAGE_NAME} to ECR repository"
fi
fi