Skip to content

A platform for community discussion. Free, open, simple.

DEV: Remove build:stamp task and related code (#15069)

Jarek Radoszc9e0ad5ec4ab
diff --git a/lib/discourse.rb b/lib/discourse.rb
index 66ea0b73f30..3e641b4e293 100644
--- a/lib/discourse.rb
+++ b/lib/discourse.rb
@@ -657,16 +657,7 @@ module Discourse
end
end
- def self.ensure_version_file_loaded
- unless @version_file_loaded
- version_file = "#{Rails.root}/config/version.rb"
- require version_file if File.exists?(version_file)
- @version_file_loaded = true
- end
- end
-
def self.git_version
- ensure_version_file_loaded
$git_version ||=
begin
git_cmd = 'git rev-parse HEAD'
@@ -675,7 +666,6 @@ module Discourse
end
def self.git_branch
- ensure_version_file_loaded
$git_branch ||=
begin
git_cmd = 'git rev-parse --abbrev-ref HEAD'
@@ -684,7 +674,6 @@ module Discourse
end
def self.full_version
- ensure_version_file_loaded
$full_version ||=
begin
git_cmd = 'git describe --dirty --match "v[0-9]*"'
@@ -693,7 +682,6 @@ module Discourse
end
def self.last_commit_date
- ensure_version_file_loaded
$last_commit_date ||=
begin
git_cmd = 'git log -1 --format="%ct"'
diff --git a/lib/tasks/build.rake b/lib/tasks/build.rake
deleted file mode 100644
index 3f719c8ea24..00000000000
--- a/lib/tasks/build.rake
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-desc "stamp the current build with the git hash placed in version.rb"
-task "build:stamp" => :environment do
- git_version = `git rev-parse HEAD`.strip
- git_branch = `git rev-parse --abbrev-ref HEAD`
- full_version = `git describe --dirty --match "v[0-9]*"`
-
- File.open(Rails.root.to_s + '/config/version.rb', 'w') do |f|
- f.write("$git_version = #{git_version.inspect}\n")
- f.write("$git_branch = #{git_branch.inspect}\n")
- f.write("$full_version = #{full_version.inspect}\n")
- end
- puts "Stamped current build with #{git_version} #{git_branch} #{full_version}"
-end