[ci] Fix timezones for dates to use commiter timezones
- Add irb as dev dependency
This commit is contained in:
3
Gemfile
3
Gemfile
@@ -4,3 +4,6 @@ source "https://rubygems.org"
|
|||||||
|
|
||||||
gem "rugged", "~> 1.4"
|
gem "rugged", "~> 1.4"
|
||||||
gem "liquid", "~> 5.3"
|
gem "liquid", "~> 5.3"
|
||||||
|
|
||||||
|
gem "irb", "~> 1.4", :group => [:development]
|
||||||
|
gem "rdoc", "~> 6.4", :group => [:development]
|
||||||
|
|||||||
12
Gemfile.lock
12
Gemfile.lock
@@ -1,14 +1,26 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
|
io-console (0.5.11)
|
||||||
|
irb (1.4.1)
|
||||||
|
reline (>= 0.3.0)
|
||||||
liquid (5.3.0)
|
liquid (5.3.0)
|
||||||
|
psych (4.0.4)
|
||||||
|
stringio
|
||||||
|
rdoc (6.4.0)
|
||||||
|
psych (>= 4.0.0)
|
||||||
|
reline (0.3.1)
|
||||||
|
io-console (~> 0.5)
|
||||||
rugged (1.4.2)
|
rugged (1.4.2)
|
||||||
|
stringio (3.0.2)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
x86_64-linux
|
x86_64-linux
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
|
irb (~> 1.4)
|
||||||
liquid (~> 5.3)
|
liquid (~> 5.3)
|
||||||
|
rdoc (~> 6.4)
|
||||||
rugged (~> 1.4)
|
rugged (~> 1.4)
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
|
|||||||
26
update.rb
26
update.rb
@@ -18,7 +18,6 @@ DEFAULT_TAG_TEMPLATE = '{{major}}.{{minor}}{% if patch %}.{{patch}}{%endif%}'
|
|||||||
|
|
||||||
def fetch_git_releases(repo_dir, url)
|
def fetch_git_releases(repo_dir, url)
|
||||||
pwd = Dir.pwd
|
pwd = Dir.pwd
|
||||||
puts "Fetching #{url}"
|
|
||||||
`git init --bare #{repo_dir}` unless Dir.exist? repo_dir
|
`git init --bare #{repo_dir}` unless Dir.exist? repo_dir
|
||||||
Dir.chdir repo_dir
|
Dir.chdir repo_dir
|
||||||
`git fetch --quiet --tags --filter=blob:none "#{url}"`
|
`git fetch --quiet --tags --filter=blob:none "#{url}"`
|
||||||
@@ -46,14 +45,23 @@ def update_git_releases(repo_dir, output_file, auto_config)
|
|||||||
|
|
||||||
tag_proper_name = render_tag(tag.name, auto_config)
|
tag_proper_name = render_tag(tag.name, auto_config)
|
||||||
|
|
||||||
if tag.target.is_a? Rugged::Tag::Annotation
|
# If the tag has an annotation, we get accurate time information
|
||||||
data[tag_proper_name] = tag.target.tagger[:time].strftime('%F')
|
# from the tag annotation "tagger"
|
||||||
|
begin
|
||||||
|
if tag.annotated?
|
||||||
|
# We pick the data from the "tagger" which includes offset information
|
||||||
|
t = tag.annotation.tagger[:time]
|
||||||
|
data[tag_proper_name] = t.strftime('%F')
|
||||||
|
puts "#{tag_proper_name}: #{t.strftime('%F %X %z')}"
|
||||||
else
|
else
|
||||||
begin
|
# In other cases, we de-reference the tag to get the commit
|
||||||
data[tag_proper_name] = tag.target.time.strftime('%F')
|
# and use the date of the commit itself
|
||||||
rescue StandardError
|
t = tag.target.committer[:time]
|
||||||
puts "[WARN] No timestamp for #{tag.name}"
|
data[tag_proper_name] = t.strftime('%F')
|
||||||
end
|
puts "#{tag_proper_name}: #{t.strftime('%F %X %z')}"
|
||||||
|
end
|
||||||
|
rescue StandardError
|
||||||
|
puts "::warning No timestamp for #{tag.name}, ignoring"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
File.open(output_file, 'w') do |file|
|
File.open(output_file, 'w') do |file|
|
||||||
@@ -98,8 +106,10 @@ Dir.glob("#{WEBSITE_DIR}/products/*.md").each do |product_file|
|
|||||||
next if OPTIONAL_PRODUCT && (OPTIONAL_PRODUCT != product)
|
next if OPTIONAL_PRODUCT && (OPTIONAL_PRODUCT != product)
|
||||||
|
|
||||||
if data['auto']['git']
|
if data['auto']['git']
|
||||||
|
puts "::group::#{product}"
|
||||||
fetch_git_releases(get_cache_dir('git', product), data['auto']['git'])
|
fetch_git_releases(get_cache_dir('git', product), data['auto']['git'])
|
||||||
update_git_releases(get_cache_dir('git', product), get_output_file('git', product), data['auto'])
|
update_git_releases(get_cache_dir('git', product), get_output_file('git', product), data['auto'])
|
||||||
|
puts "::endgroup::"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user