mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-28 17:52:39 +00:00
chore: add build id to settings page (#6873)
- Adds a build Id to the settings page
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
.bundle
|
||||
.env
|
||||
.env.*
|
||||
.git
|
||||
.gitignore
|
||||
docker-compose.*
|
||||
docker/Dockerfile
|
||||
docker/dockerfiles
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -61,7 +61,7 @@ test/cypress/videos/*
|
||||
/config/master.key
|
||||
/config/*.enc
|
||||
|
||||
.vscode/settings.json
|
||||
#ignore files under .vscode directory
|
||||
.vscode
|
||||
|
||||
# yalc for local testing
|
||||
|
||||
2
Procfile
2
Procfile
@@ -1,3 +1,3 @@
|
||||
release: POSTGRES_STATEMENT_TIMEOUT=600s bundle exec rails db:chatwoot_prepare
|
||||
release: POSTGRES_STATEMENT_TIMEOUT=600s bundle exec rails db:chatwoot_prepare && echo $SOURCE_VERSION > .git_sha
|
||||
web: bundle exec rails ip_lookup:setup && bin/rails server -p $PORT -e $RAILS_ENV
|
||||
worker: bundle exec rails ip_lookup:setup && bundle exec sidekiq -C config/sidekiq.yml
|
||||
|
||||
@@ -56,7 +56,8 @@ class DashboardController < ActionController::Base
|
||||
FB_APP_ID: GlobalConfigService.load('FB_APP_ID', ''),
|
||||
FACEBOOK_API_VERSION: 'v14.0',
|
||||
IS_ENTERPRISE: ChatwootApp.enterprise?,
|
||||
AZURE_APP_ID: ENV.fetch('AZURE_APP_ID', '')
|
||||
AZURE_APP_ID: ENV.fetch('AZURE_APP_ID', ''),
|
||||
GIT_SHA: GIT_HASH
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -104,6 +104,9 @@
|
||||
})
|
||||
}}
|
||||
</div>
|
||||
<div class="build-id">
|
||||
<div>{{ `Build ${globalConfig.gitSha}` }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<woot-submit-button
|
||||
|
||||
@@ -9,6 +9,7 @@ const {
|
||||
CREATE_NEW_ACCOUNT_FROM_DASHBOARD: createNewAccountFromDashboard,
|
||||
DIRECT_UPLOADS_ENABLED: directUploadsEnabled,
|
||||
DISPLAY_MANIFEST: displayManifest,
|
||||
GIT_SHA: gitSha,
|
||||
HCAPTCHA_SITE_KEY: hCaptchaSiteKey,
|
||||
INSTALLATION_NAME: installationName,
|
||||
LOGO_THUMBNAIL: logoThumbnail,
|
||||
@@ -33,6 +34,7 @@ const state = {
|
||||
directUploadsEnabled: directUploadsEnabled === 'true',
|
||||
disableUserProfileUpdate: disableUserProfileUpdate === 'true',
|
||||
displayManifest,
|
||||
gitSha,
|
||||
hCaptchaSiteKey,
|
||||
installationName,
|
||||
logo,
|
||||
|
||||
13
config/initializers/git_sha.rb
Normal file
13
config/initializers/git_sha.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
# Define a method to fetch the git commit hash
|
||||
def fetch_git_sha
|
||||
sha = `git rev-parse HEAD`
|
||||
if sha.present?
|
||||
sha.strip
|
||||
elsif File.exist?('.git_sha')
|
||||
File.read('.git_sha').strip
|
||||
else
|
||||
'unknown'
|
||||
end
|
||||
end
|
||||
|
||||
GIT_HASH = fetch_git_sha
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user