1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2026-03-04 14:54:08 +00:00

Compare commits

3 الالتزامات
3.3.1 ... 3.3.2

المؤلف SHA1 الرسالة التاريخ
github-actions[bot]
c12f30e300 chore(main): release 3.3.2 (#2892)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-22 10:40:20 +00:00
Adam Cooke
5a2f31ed77 doc: fix doc for Postal.version 2024-03-21 14:58:11 +00:00
Adam Cooke
07c6b317f2 refactor(versioning): improve how current version and branch is determined and set
Refactor `Postal.version`` and `Postal.branch` and remove `Postal::VERSION`.
2024-03-21 14:55:14 +00:00
5 ملفات معدلة مع 33 إضافات و29 حذوفات

عرض الملف

@@ -1,3 +1,3 @@
{ {
".": "3.3.1" ".": "3.3.2"
} }

عرض الملف

@@ -2,6 +2,13 @@
This file contains all the latest changes and updates to Postal. This file contains all the latest changes and updates to Postal.
## [3.3.2](https://github.com/postalserver/postal/compare/3.3.1...3.3.2) (2024-03-21)
### Code Refactoring
* **versioning:** improve how current version and branch is determined and set ([07c6b31](https://github.com/postalserver/postal/commit/07c6b317f2b9dc04b6a8c88df1e6aa9e54597504))
## [3.3.1](https://github.com/postalserver/postal/compare/3.3.0...3.3.1) (2024-03-21) ## [3.3.1](https://github.com/postalserver/postal/compare/3.3.0...3.3.1) (2024-03-21)

عرض الملف

@@ -43,10 +43,10 @@ COPY ./docker/wait-for.sh /docker-entrypoint.sh
COPY --chown=postal . . COPY --chown=postal . .
# Export the version # Export the version
ARG VERSION=null ARG VERSION
ARG BRANCH=null ARG BRANCH
RUN echo $VERSION > VERSION \ RUN if [ "$VERSION" != "" ]; then echo $VERSION > VERSION; fi \
&& echo $BRANCH > BRANCH && if [ "$BRANCH" != "" ]; then echo $BRANCH > BRANCH; fi
# 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

عرض الملف

@@ -13,7 +13,6 @@ require "dotenv"
require "klogger" require "klogger"
require_relative "error" require_relative "error"
require_relative "version"
require_relative "config_schema" require_relative "config_schema"
require_relative "legacy_config_source" require_relative "legacy_config_source"
require_relative "signer" require_relative "signer"
@@ -131,7 +130,7 @@ module Postal
notifier.notify!(short_message: short_message, **{ notifier.notify!(short_message: short_message, **{
facility: Config.gelf.facility, facility: Config.gelf.facility,
_environment: Config.rails.environment, _environment: Config.rails.environment,
_version: Postal::VERSION.to_s, _version: Postal.version.to_s,
_group_ids: group_ids.join(" ") _group_ids: group_ids.join(" ")
}.merge(payload.transform_keys { |k| "_#{k}".to_sym }.transform_values(&:to_s))) }.merge(payload.transform_keys { |k| "_#{k}".to_sym }.transform_values(&:to_s)))
end end
@@ -159,10 +158,26 @@ module Postal
def branch def branch
return @branch if instance_variable_defined?("@branch") return @branch if instance_variable_defined?("@branch")
@branch = begin @branch ||= read_version_file("BRANCH")
path = Rails.root.join("BRANCH") end
File.read(path).strip if File.exist?(path)
end # Return the version
#
# @return [String, nil]
def version
return @version if instance_variable_defined?("@version")
@version ||= read_version_file("VERSION") || "0.0.0"
end
private
def read_version_file(file)
path = Rails.root.join(file)
return unless File.exist?(path)
value = File.read(path).strip
value.empty? ? nil : value
end end
end end

عرض الملف

@@ -1,18 +0,0 @@
# frozen_string_literal: true
module Postal
VERSION_PATH = File.expand_path("../../VERSION", __dir__)
if File.file?(VERSION_PATH)
VERSION = File.read(VERSION_PATH).strip.delete_prefix("v")
else
VERSION = "0.0.0-dev"
end
def self.version
VERSION
end
Version = VERSION
end