Skip to content

Commit

Permalink
Show github commit info
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinNagpal committed Jan 21, 2025
1 parent 998470d commit b5ec07c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/cf-ai-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ jobs:
IMAGE_TAG=${{ github.sha }}
GIT_COMMIT_HASH=$(git rev-parse HEAD)
GIT_COMMIT_MESSAGE=$(git log -1 --pretty=%B)
docker build --build-arg GIT_COMMIT_HASH=$GIT_COMMIT_HASH --build-arg GIT_COMMIT_MESSAGE="$GIT_COMMIT_MESSAGE" -t ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:$IMAGE_TAG .
docker build \
--build-arg BUILD_GIT_COMMIT_HASH=$GIT_COMMIT_HASH \
--build-arg BUILD_GIT_COMMIT_MESSAGE="$GIT_COMMIT_MESSAGE" \
-t ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:$IMAGE_TAG .
- name: Tag Docker Image
working-directory: dodao-ai-agents/crowd-fund-analysis
Expand Down
13 changes: 13 additions & 0 deletions dodao-ai-agents/crowd-fund-analysis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ RUN poetry config virtualenvs.create false \
# Expose Flask's default port
EXPOSE 5000

# Set environment variables for Flask
ENV FLASK_ENV=development
ENV GIT_COMMIT_HASH=unknown
ENV GIT_COMMIT_MESSAGE="Default commit message"

# Set build-time environment variables
ARG BUILD_GIT_COMMIT_HASH
ARG BUILD_GIT_COMMIT_MESSAGE

# Persist commit information into runtime environment
RUN echo "GIT_COMMIT_HASH=${BUILD_GIT_COMMIT_HASH}" >> /etc/environment \
&& echo "GIT_COMMIT_MESSAGE='${BUILD_GIT_COMMIT_MESSAGE}'" >> /etc/environment

# Set environment variables for Flask
ENV FLASK_ENV=development

Expand Down

0 comments on commit b5ec07c

Please sign in to comment.