Read about our upcoming Code of Conduct on this issue

Commit ca336bca authored by Tiger Watson's avatar Tiger Watson
Browse files

Merge branch...

Merge branch '1334-job-failed-1691373839-make-verify-asdf-combine-fails-because-gitlab-hasn-t-been-cloned-yet' into 'main'

Fetch version files via HTTP for support/asdf-combine

Closes #1334

See merge request gitlab-org/gitlab-development-kit!2217
......@@ -108,6 +108,11 @@ verify-asdf-combine:
- make verify-asdf-combine
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_MERGE_REQUEST_IID'
changes:
- ".tool-versions*"
- "support/asdf-combine"
- "support/ci/verify-asdf-combine"
danger-review:
extends:
......
......@@ -2,7 +2,7 @@
# files from GDK sub-projects.
#
# Do not modify this file directly.
golang 1.16.9 1.16.8 1.17.1
golang 1.17.1 1.16.9 1.16.8
minio 2021-04-06T23-11-00Z
nodejs 14.17.5
postgres 12.6 11.9
......
......@@ -8,7 +8,7 @@ ruby 2.7.4 3.0.2
# At least one Go version must match a Go version set in the `.tool-versions` file of the version of
# the `gitlab-pages` and `gitaly` projects used by GDK. See `pages_version` and `gitaly_version` in
# the GDK Makefile.
golang 1.16.9
golang 1.17.1
nodejs 14.17.5
yarn 1.22.11
minio 2021-04-06T23-11-00Z
......
......@@ -7,11 +7,13 @@ require 'net/http'
require_relative '../lib/gdk'
GITLAB_PROJECT_BASE_URL = 'https://gitlab.com/gitlab-org/gitlab'
TOOL_VERSIONS_FILES = [
{ version: -> { "v#{version_from_file('gitlab/GITLAB_PAGES_VERSION')}" }, base_url: 'https://gitlab.com/gitlab-org/gitlab-pages' },
{ version: -> { version_from_file('gitlab/GITALY_SERVER_VERSION') }, base_url: 'https://gitlab.com/gitlab-org/gitaly' },
{ version: -> { 'main' }, base_url: 'https://gitlab.com/gitlab-org/gitlab-ui' },
{ version: -> { 'main' }, base_url: 'https://gitlab.com/gitlab-org/gitlab-docs' }
{ ref: -> { "v#{ref_from_remote_file('GITLAB_PAGES_VERSION')}" }, base_url: 'https://gitlab.com/gitlab-org/gitlab-pages' },
{ ref: -> { ref_from_remote_file('GITALY_SERVER_VERSION') }, base_url: 'https://gitlab.com/gitlab-org/gitaly' },
{ ref: -> { 'main' }, base_url: 'https://gitlab.com/gitlab-org/gitlab-ui' },
{ ref: -> { 'main' }, base_url: 'https://gitlab.com/gitlab-org/gitlab-docs' }
].freeze
HEADER_CONTENT = <<~CONTENT
......@@ -49,8 +51,9 @@ def write_tool_versions_file(tool_versions_data)
gdk_root.join('.tool-versions').write("#{HEADER_CONTENT}#{formatted_tool_versions_data}\n")
end
def version_from_file(file)
gdk_root.join(file).read.chomp
def ref_from_remote_file(file)
url = "#{GITLAB_PROJECT_BASE_URL}/-/raw/master/#{file}"
http_get(url).chomp
end
# ------------------------------------------------------------------------------
......@@ -58,13 +61,19 @@ end
tool_versions_data = read_tool_versions_from(gdk_root.join('.tool-versions-gdk').read)
TOOL_VERSIONS_FILES.each do |entry|
version = entry[:version].call
url = "#{entry[:base_url]}/-/raw/#{version}/.tool-versions"
ref = entry[:ref].call
url = "#{entry[:base_url]}/-/raw/#{ref}/.tool-versions"
puts
puts url
puts '-' * url.length
software, versions = read_tool_versions_from(http_get(url)).first
read_tool_versions_from(http_get(url)).each do |software, versions|
puts "#{software} #{versions.join(' ')}"
tool_versions_data[software] ||= []
tool_versions_data[software] |= versions
tool_versions_data[software] ||= []
tool_versions_data[software] |= versions
end
end
write_tool_versions_file(tool_versions_data)
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