This instance will be upgraded to Heptapod 0.31.0 (final) on 2022-05-24 at 14:00 UTC+2 (a few minutes of down time)

Commit ad38173d authored by Ash McKenzie's avatar Ash McKenzie
Browse files

When checking .tool-versions, check proper branch

parent 5cf77bb6aaf0
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
require_relative '../lib/gdk' require_relative '../lib/gdk'
TOOL_VERSIONS_FILES = %w[ TOOL_VERSIONS_FILES = [
https://gitlab.com/gitlab-org/gitlab-pages/-/raw/master/.tool-versions { version: -> { "v#{version_from_file('gitlab/GITLAB_PAGES_VERSION')}" }, base_url: 'https://gitlab.com/gitlab-org/gitlab-pages' },
https://gitlab.com/gitlab-org/gitaly/-/raw/master/.tool-versions { version: -> { version_from_file('gitlab/GITALY_SERVER_VERSION') }, base_url: 'https://gitlab.com/gitlab-org/gitaly' },
https://gitlab.com/gitlab-org/gitlab-ui/-/raw/main/.tool-versions { version: -> { 'main' }, base_url: 'https://gitlab.com/gitlab-org/gitlab-ui' },
https://gitlab.com/gitlab-org/gitlab-docs/-/raw/main/.tool-versions { version: -> { 'main' }, base_url: 'https://gitlab.com/gitlab-org/gitlab-docs' }
].freeze ].freeze
HEADER_CONTENT = <<~CONTENT HEADER_CONTENT = <<~CONTENT
...@@ -49,7 +49,11 @@ ...@@ -49,7 +49,11 @@
gdk_root.join('.tool-versions').write("#{HEADER_CONTENT}#{formatted_tool_versions_data}\n") gdk_root.join('.tool-versions').write("#{HEADER_CONTENT}#{formatted_tool_versions_data}\n")
end end
def version_from_file(file)
gdk_root.join(file).read.chomp
end
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
tool_versions_data = read_tool_versions_from(gdk_root.join('.tool-versions-gdk').read) tool_versions_data = read_tool_versions_from(gdk_root.join('.tool-versions-gdk').read)
...@@ -52,6 +56,9 @@ ...@@ -52,6 +56,9 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
tool_versions_data = read_tool_versions_from(gdk_root.join('.tool-versions-gdk').read) tool_versions_data = read_tool_versions_from(gdk_root.join('.tool-versions-gdk').read)
TOOL_VERSIONS_FILES.each do |url| TOOL_VERSIONS_FILES.each do |entry|
version = entry[:version].call
url = "#{entry[:base_url]}/-/raw/#{version}/.tool-versions"
software, versions = read_tool_versions_from(http_get(url)).first software, versions = read_tool_versions_from(http_get(url)).first
...@@ -57,4 +64,5 @@ ...@@ -57,4 +64,5 @@
software, versions = read_tool_versions_from(http_get(url)).first software, versions = read_tool_versions_from(http_get(url)).first
tool_versions_data[software] ||= [] tool_versions_data[software] ||= []
tool_versions_data[software] |= versions tool_versions_data[software] |= versions
end end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment