Skip to content
Snippets Groups Projects
Commit bc8dbe5d authored by Marin Jankovski's avatar Marin Jankovski
Browse files

Create a way to override software remotes

parent 078e7d3f
No related branches found
No related tags found
1 merge request!976Read custom sources from a file
gitlab-rails:
remote: "git@dev.gitlab.org:gitlab/gitlabhq.git"
gitlab-rails-ee:
remote: "git@dev.gitlab.org:gitlab/gitlab-ee.git"
gitlab-shell:
remote: "git@dev.gitlab.org:gitlab/gitlab-shell.git"
gitlab-workhorse:
remote: "git@dev.gitlab.org:gitlab/gitlab-workhorse.git"
gitlab-pages:
remote: "git@dev.gitlab.org:gitlab/gitlab-pages.git"
config_guess:
remote: "git@dev.gitlab.org:omnibus-mirror/config_guess.git"
Loading
Loading
@@ -17,6 +17,7 @@
#
 
require "#{Omnibus::Config.project_root}/lib/gitlab/build_iteration"
require "#{Omnibus::Config.project_root}/lib/gitlab/version"
 
ee = system("#{Omnibus::Config.project_root}/support/is_gitlab_ee.sh")
 
Loading
Loading
@@ -60,6 +61,10 @@ else
end
build_iteration Gitlab::BuildIteration.new.build_iteration
 
# Overrides for remote URLs of the software
# Original git://git.sv.gnu.org/config.git is failing intermittently
config_guess_remote = Gitlab::Version.new('config_guess').remote
override :ruby, version: '2.3.1', source: { md5: '0d896c2e7fd54f722b399f407e48a4c6' }
override :rubygems, version: '2.6.6'
override :'chef-gem', version: '12.12.15'
Loading
Loading
@@ -69,7 +74,7 @@ override :liblzma, version: '5.2.2', source: { md5: '7cf6a8544a7dae8e8106fdf7add
override :libxml2, version: '2.9.4', source: { md5: 'ae249165c173b1ff386ee8ad676815f5' }
override :pcre, version: '8.38', source: { md5: '8a353fe1450216b6655dfcf3561716d9', url: "http://downloads.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.tar.gz" }
override :expat, version: '2.2.0', source: { md5: '2f47841c829facb346eb6e3fab5212e2', url: "http://downloads.sourceforge.net/project/expat/expat/2.2.0/expat-2.2.0.tar.bz2" }
override :config_guess, source: { git: "git@dev.gitlab.org:omnibus-mirror/config_guess.git" } # Original git://git.sv.gnu.org/config.git is failing intermittently
override :config_guess, source: { git: config_guess_remote }
override :rsync, version: '3.1.2'
 
# Openssh needs to be installed
Loading
Loading
Loading
Loading
@@ -15,7 +15,7 @@
# limitations under the License.
#
require "#{Omnibus::Config.project_root}/lib/gitlab/version"
version = Gitlab::Version.new("GITLAB_PAGES_VERSION")
version = Gitlab::Version.new("gitlab-pages")
 
name "gitlab-pages"
default_version version.print
Loading
Loading
Loading
Loading
@@ -16,10 +16,16 @@
# limitations under the License.
#
require "#{Omnibus::Config.project_root}/lib/gitlab/version"
version = Gitlab::Version.new("VERSION")
EE = system("#{Omnibus::Config.project_root}/support/is_gitlab_ee.sh")
software_name = EE ? "gitlab-rails-ee":"gitlab-rails"
version = Gitlab::Version.new(software_name)
 
name "gitlab-rails"
default_version version.print
source git: version.remote
 
combined_licenses_file = "#{install_dir}/embedded/service/gem/gitlab-gem-licenses"
gems_directory = "#{install_dir}/embedded/service/gem/ruby/2.3.0/gems"
Loading
Loading
@@ -28,8 +34,6 @@ license "MIT"
license_file "LICENSE"
license_file combined_licenses_file
 
EE = system("#{Omnibus::Config.project_root}/support/is_gitlab_ee.sh")
dependency "ruby"
dependency "bundler"
dependency "libxml2"
Loading
Loading
@@ -48,7 +52,6 @@ if EE
dependency "gitlab-pages"
end
 
source :git => version.remote
 
build do
env = with_standard_compiler_flags(with_embedded_path)
Loading
Loading
@@ -69,7 +72,7 @@ build do
# This patch makes the github-markup gem use and be compatible with Python3
# We've sent part of the changes upstream: https://github.com/github/markup/pull/919
patch source: 'github-markup_gem-markups.patch', target: "#{gems_directory}/github-markup-1.4.0/lib/github/markups.rb"
patch source: 'github-markup_gem-rest2html.patch', target: "#{gems_directory}/github-markup-1.4.0/lib/github/commands/rest2html"
patch source: 'github-markup_gem-rest2html.patch', target: "#{gems_directory}/github-markup-1.4.0/lib/github/commands/rest2html"
 
# In order to precompile the assets, we need to get to a state where rake can
# load the Rails environment.
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@
##
#
require "#{Omnibus::Config.project_root}/lib/gitlab/version"
version = Gitlab::Version.new("GITLAB_SHELL_VERSION")
version = Gitlab::Version.new("gitlab-shell")
 
name "gitlab-shell"
default_version version.print
Loading
Loading
@@ -26,7 +26,7 @@ license_file "LICENSE"
 
dependency "ruby"
 
source :git => version.remote
source git: version.remote
 
build do
command "mkdir -p #{install_dir}/embedded/service/gitlab-shell"
Loading
Loading
Loading
Loading
@@ -15,7 +15,7 @@
# limitations under the License.
#
require "#{Omnibus::Config.project_root}/lib/gitlab/version"
version = Gitlab::Version.new("GITLAB_WORKHORSE_VERSION")
version = Gitlab::Version.new("gitlab-workhorse")
 
name "gitlab-workhorse"
default_version version.print
Loading
Loading
require 'yaml'
module Gitlab
class Version
 
def initialize(filename)
@filename = filename
filepath = File.expand_path(@filename, Omnibus::Config.project_root)
@read_version = File.read(filepath).chomp
def initialize(software_name, version)
@software = software_name
@read_version = if version
version
else
read_version_from_file
end
end
def read_version_from_file
filepath = File.expand_path(version_file, Omnibus::Config.project_root)
File.read(filepath).chomp
rescue Errno::ENOENT
# Didn't find the file
@read_version = ""
end
 
def version_file
case @software
when "gitlab-rails" || "gitlab-rails-ee"
"VERSION"
when "gitlab-shell"
"GITLAB_SHELL_VERSION"
when "gitlab-workhorse"
"GITLAB_WORKHORSE_VERSION"
when "gitlab-pages"
"GITLAB_PAGES_VERSION"
else
nil
end
end
def print
if @read_version.include?('.pre') || @read_version == "master"
"master"
Loading
Loading
@@ -23,22 +49,8 @@ module Gitlab
end
 
def remote
case @filename
when "VERSION"
if @read_version.include?('-ee')
"git@dev.gitlab.org:gitlab/gitlab-ee.git"
else
"git@dev.gitlab.org:gitlab/gitlabhq.git"
end
when "GITLAB_SHELL_VERSION"
"git@dev.gitlab.org:gitlab/gitlab-shell.git"
when "GITLAB_WORKHORSE_VERSION"
"git@dev.gitlab.org:gitlab/gitlab-workhorse.git"
when "GITLAB_PAGES_VERSION"
"https://gitlab.com/gitlab-org/gitlab-pages.git"
else
nil
end
filepath = File.expand_path(".custom_sources.yml", Omnibus::Config.project_root)
YAML.load_file(filepath)[@software]['remote']
end
end
end
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