chore: add build id to settings page (#6873)

- Adds a build Id to the settings page
This commit is contained in:
Vishnu Narayanan
2023-04-18 00:35:35 +05:30
committed by GitHub
parent c9ce9e5b8f
commit 4505c5dda3
8 changed files with 31 additions and 6 deletions

View File

@@ -60,9 +60,14 @@ RUN if [ "$RAILS_ENV" = "production" ]; then \
&& rm -rf spec node_modules tmp/cache; \
fi
# Generate .git_sha file with current commit hash
RUN git rev-parse HEAD > /app/.git_sha
# Remove unnecessary files
RUN rm -rf /gems/ruby/3.1.0/cache/*.gem \
&& find /gems/ruby/3.1.0/gems/ \( -name "*.c" -o -name "*.o" \) -delete
&& find /gems/ruby/3.1.0/gems/ \( -name "*.c" -o -name "*.o" \) -delete \
&& rm -rf .git \
&& rm .gitignore
# final build stage
FROM ruby:3.1.3-alpine3.16
@@ -100,6 +105,9 @@ RUN if [ "$RAILS_ENV" != "production" ]; then \
COPY --from=pre-builder /gems/ /gems/
COPY --from=pre-builder /app /app
# Copy .git_sha file from pre-builder stage
COPY --from=pre-builder /app/.git_sha /app/.git_sha
WORKDIR /app
EXPOSE 3000