مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-11-30 21:32:30 +00:00
Merge pull request #2891 from postalserver/export-branch-to-image
هذا الالتزام موجود في:
2
.github/workflows/ci.yml
مباع
2
.github/workflows/ci.yml
مباع
@@ -87,6 +87,7 @@ jobs:
|
|||||||
|
|
||||||
VER="$(git describe --tags 2>/dev/null)"
|
VER="$(git describe --tags 2>/dev/null)"
|
||||||
echo "version=${VER}" >> "$GITHUB_OUTPUT"
|
echo "version=${VER}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "branch=${REF}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
echo 'tags<<EOF' >> "$GITHUB_OUTPUT"
|
echo 'tags<<EOF' >> "$GITHUB_OUTPUT"
|
||||||
if [[ "$REF" == "main" ]]; then
|
if [[ "$REF" == "main" ]]; then
|
||||||
@@ -105,6 +106,7 @@ jobs:
|
|||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
build-args: |
|
build-args: |
|
||||||
VERSION=${{ steps.info.outputs.version }}
|
VERSION=${{ steps.info.outputs.version }}
|
||||||
|
BRANCH=${{ steps.info.outputs.branch }}
|
||||||
|
|
||||||
publish-image:
|
publish-image:
|
||||||
name: Publish Image
|
name: Publish Image
|
||||||
|
|||||||
1
.gitignore
مباع
1
.gitignore
مباع
@@ -29,6 +29,7 @@ vendor/bundle
|
|||||||
|
|
||||||
Procfile.local
|
Procfile.local
|
||||||
VERSION
|
VERSION
|
||||||
|
BRANCH
|
||||||
|
|
||||||
.rubocop-https*
|
.rubocop-https*
|
||||||
.env*
|
.env*
|
||||||
|
|||||||
@@ -43,8 +43,10 @@ COPY ./docker/wait-for.sh /docker-entrypoint.sh
|
|||||||
COPY --chown=postal . .
|
COPY --chown=postal . .
|
||||||
|
|
||||||
# Export the version
|
# Export the version
|
||||||
ARG VERSION=unspecified
|
ARG VERSION=null
|
||||||
RUN echo $VERSION > VERSION
|
ARG BRANCH=null
|
||||||
|
RUN echo $VERSION > VERSION \
|
||||||
|
&& echo $BRANCH > BRANCH
|
||||||
|
|
||||||
# Set paths for when running in a container
|
# Set paths for when running in a container
|
||||||
ENV POSTAL_CONFIG_FILE_PATH=/config/postal.yml
|
ENV POSTAL_CONFIG_FILE_PATH=/config/postal.yml
|
||||||
|
|||||||
@@ -100,4 +100,11 @@ module ApplicationHelper
|
|||||||
end.html_safe
|
end.html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def postal_version_string
|
||||||
|
string = Postal.version
|
||||||
|
string += " (#{Postal.branch})" if Postal.branch &&
|
||||||
|
Postal.branch != "main"
|
||||||
|
string
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -55,6 +55,8 @@
|
|||||||
%footer.siteContent__footer
|
%footer.siteContent__footer
|
||||||
%ul.footer__links
|
%ul.footer__links
|
||||||
%li.footer__name
|
%li.footer__name
|
||||||
Powered by #{link_to "Postal", "https://postalserver.io", target: '_blank'} #{Postal.version}.
|
Powered by
|
||||||
|
#{link_to "Postal", "https://postalserver.io", target: '_blank'}
|
||||||
|
#{postal_version_string}
|
||||||
%li= link_to "Documentation", "https://docs.postalserver.io", target: '_blank'
|
%li= link_to "Documentation", "https://docs.postalserver.io", target: '_blank'
|
||||||
%li= link_to "Ask for help", "https://discussions.postalserver.io", target: '_blank'
|
%li= link_to "Ask for help", "https://discussions.postalserver.io", target: '_blank'
|
||||||
|
|||||||
@@ -153,6 +153,18 @@ module Postal
|
|||||||
ActiveRecord::Base.establish_connection(config.merge(pool: new_size))
|
ActiveRecord::Base.establish_connection(config.merge(pool: new_size))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Return the branch name which created this release
|
||||||
|
#
|
||||||
|
# @return [String, nil]
|
||||||
|
def branch
|
||||||
|
return @branch if instance_variable_defined?("@branch")
|
||||||
|
|
||||||
|
@branch = begin
|
||||||
|
path = Rails.root.join("BRANCH")
|
||||||
|
File.read(path).strip if File.exist?(path)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Config = initialize_config
|
Config = initialize_config
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم