Skip to content
Snippets Groups Projects
Commit 04222791 authored by DJ Mountney's avatar DJ Mountney
Browse files

Fix what was broken with the previous commits, so it actually updates the version

parent f4e8b31b
No related branches found
No related tags found
1 merge request!120Omnibus-repo release openshift template
Loading
Loading
@@ -148,9 +148,9 @@ module Release
 
repository.ensure_branch_exists(branch)
openshift_filename = 'docker/openshift-template.json'
openshift_version = Version.new(version_from_container_template(openshift_filename))
openshift_version = version_class.new(version_from_container_template(openshift_filename).gsub('-', '+'))
unless openshift_version.valid?
raise VersionStringNotFoundError.new(openshift_filename)
raise VersionStringNotFoundError.new("#{openshift_version} in #{openshift_filename}")
end
 
# Only bump the version if newer that what is already in the template
Loading
Loading
@@ -173,13 +173,10 @@ module Release
unless File.exist?(file_path)
raise TemplateFileDoesNotExistError.new(file_path)
end
File.open(file_path, 'r+') do |file|
content = file.read
content.gsub!(%r{gitlab/gitlab-ce:\d+\.\d+\.\d+-ce\.\d+}, "gitlab/gitlab-ce:#{version.to_docker}")
content.gsub!(/gitlab-\d+\.\d+\.\d+/, "gitlab-#{version.to_patch}")
file.puts content
end
content = File.read(file_path)
content.gsub!(%r{gitlab/gitlab-ce:\d+\.\d+\.\d+-ce\.\d+}, "gitlab/gitlab-ce:#{version.to_docker}")
content.gsub!(/gitlab-\d+\.\d+\.\d+/, "gitlab-#{version.to_patch}")
File.write(file_path, content)
end
end
end
Loading
Loading
@@ -138,8 +138,12 @@ class Version < String
str << '.0'
end
 
def from_omnibus
self.class.new(to_s.gsub(/-ce$/, ''))
end
def to_docker(ee: false)
to_omnibus(ee).tr('+', '-')
to_omnibus(ee: ee).tr('+', '-')
end
 
def to_patch
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment