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

Add regex anchors to openshift template version bump.

Also fixed spelling mistakes
parent ebcb5eff
No related branches found
No related tags found
1 merge request!120Omnibus-repo release openshift template
Pipeline #
Loading
Loading
@@ -172,12 +172,12 @@ module Release
raise VersionStringNotFoundError.new("#{openshift_version} in #{file_path}")
end
 
# Only bump the version if newer that what is already in the template
# Only bump the version if newer than what is already in the template
return unless version > openshift_version
 
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}")
content.sub!(%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}")
repository.write_file(file_path, content)
repository.commit(file_path, "Update #{file_path} to #{version.to_docker}")
end
Loading
Loading
Loading
Loading
@@ -134,7 +134,7 @@ module RuggedMatchers
#
# Examples:
#
# expect(repository).to have_have_container_template('docer/openshift-template.json').match('gitlab/gitlab-ce:1.2.3-ce.0')
# expect(repository).to_have_container_template('docer/openshift-template.json').match('gitlab/gitlab-ce:1.2.3-ce.0')
# expect(repository).not_to have_container_template('docer/openshift-template.json')
matcher :have_container_template do |file_path|
match do |repository|
Loading
Loading
@@ -147,16 +147,6 @@ module RuggedMatchers
end
end
 
match_when_negated do |repository|
@actual = file_path
begin
read_head_blob(repository, @actual)[@match_data].nil?
rescue NoMethodError
true
end
end
chain :match do |match|
@match_data = match
end
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