Commit d277a9e645af2f4b6a85a4baae974441f5264dfc

Authored by Jacob Vosmaer
2 parents 0a91bb64 97929cb4

Merge branch 'omnibus_3_0' into 'master'

Update omnibus-ruby to version 3.0.0
1 source 'https://rubygems.org' 1 source 'https://rubygems.org'
2 2
3 -gem 'omnibus', '~> 1.3.0' 3 +gem 'omnibus', '~> 3.0.0'
4 gem 'omnibus-software', :git => 'git://github.com/opscode/omnibus-software.git', :branch => 'master' 4 gem 'omnibus-software', :git => 'git://github.com/opscode/omnibus-software.git', :branch => 'master'
1 GIT 1 GIT
2 remote: git://github.com/opscode/omnibus-software.git 2 remote: git://github.com/opscode/omnibus-software.git
3 - revision: 3d9d097332199fdafc3237c0ec11fcd784c11b4d 3 + revision: 0dddef2baefd5f62dd38ff2ae6e5491bfb394479
4 branch: master 4 branch: master
5 specs: 5 specs:
6 omnibus-software (0.0.1) 6 omnibus-software (0.0.1)
@@ -8,16 +8,17 @@ GIT @@ -8,16 +8,17 @@ GIT
8 GEM 8 GEM
9 remote: https://rubygems.org/ 9 remote: https://rubygems.org/
10 specs: 10 specs:
11 - addressable (2.3.5)  
12 - arr-pm (0.0.8) 11 + addressable (2.3.6)
  12 + arr-pm (0.0.9)
13 cabin (> 0) 13 cabin (> 0)
14 - backports (3.3.5) 14 + backports (3.6.0)
15 cabin (0.6.1) 15 cabin (0.6.1)
16 - childprocess (0.3.9) 16 + chef-sugar (1.2.6)
  17 + childprocess (0.5.2)
17 ffi (~> 1.0, >= 1.0.11) 18 ffi (~> 1.0, >= 1.0.11)
18 clamp (0.6.3) 19 clamp (0.6.3)
19 ffi (1.9.3) 20 ffi (1.9.3)
20 - fpm (1.0.1) 21 + fpm (1.0.2)
21 arr-pm (~> 0.0.8) 22 arr-pm (~> 0.0.8)
22 backports (>= 2.6.2) 23 backports (>= 2.6.2)
23 cabin (>= 0.6.0) 24 cabin (>= 0.6.0)
@@ -26,7 +27,7 @@ GEM @@ -26,7 +27,7 @@ GEM
26 ffi 27 ffi
27 ftw (~> 0.0.30) 28 ftw (~> 0.0.30)
28 json (>= 1.7.7) 29 json (>= 1.7.7)
29 - ftw (0.0.38) 30 + ftw (0.0.39)
30 addressable 31 addressable
31 backports (>= 2.6.2) 32 backports (>= 2.6.2)
32 cabin (> 0) 33 cabin (> 0)
@@ -47,24 +48,23 @@ GEM @@ -47,24 +48,23 @@ GEM
47 mixlib-shellout 48 mixlib-shellout
48 systemu (~> 2.5.2) 49 systemu (~> 2.5.2)
49 yajl-ruby 50 yajl-ruby
50 - omnibus (1.3.0) 51 + omnibus (3.0.0)
  52 + chef-sugar (~> 1.2)
51 fpm (~> 1.0.0) 53 fpm (~> 1.0.0)
52 - mixlib-config (~> 2.1.0)  
53 - mixlib-shellout (~> 1.3.0)  
54 - ohai (>= 0.6.12)  
55 - rake (>= 0.9) 54 + mixlib-config (~> 2.1)
  55 + mixlib-shellout (~> 1.3)
  56 + ohai (~> 6.12)
56 thor (>= 0.16.0) 57 thor (>= 0.16.0)
57 uber-s3 58 uber-s3
58 - rake (10.1.0)  
59 systemu (2.5.2) 59 systemu (2.5.2)
60 - thor (0.18.1) 60 + thor (0.19.1)
61 uber-s3 (0.2.4) 61 uber-s3 (0.2.4)
62 mime-types (~> 1.17) 62 mime-types (~> 1.17)
63 - yajl-ruby (1.1.0) 63 + yajl-ruby (1.2.0)
64 64
65 PLATFORMS 65 PLATFORMS
66 ruby 66 ruby
67 67
68 DEPENDENCIES 68 DEPENDENCIES
69 - omnibus (~> 1.3.0) 69 + omnibus (~> 3.0.0)
70 omnibus-software! 70 omnibus-software!
config/software/git.rb
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 # 17 #
18 18
19 name "git" 19 name "git"
20 -version "1.8.5.3" 20 +default_version "1.8.5.3"
21 21
22 dependency "zlib" 22 dependency "zlib"
23 dependency "openssl" 23 dependency "openssl"
config/software/gitlab-rails.rb
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 # 17 #
18 18
19 name "gitlab-rails" 19 name "gitlab-rails"
20 -version "master" 20 +default_version "master"
21 21
22 dependency "ruby" 22 dependency "ruby"
23 dependency "bundler" 23 dependency "bundler"
config/software/gitlab-shell.rb
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 # 17 #
18 18
19 name "gitlab-shell" 19 name "gitlab-shell"
20 -version "v1.9.1" 20 +default_version "master"
21 21
22 dependency "ruby" 22 dependency "ruby"
23 dependency "rsync" 23 dependency "rsync"
config/software/libicu.rb
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 # 17 #
18 18
19 name "libicu" 19 name "libicu"
20 -version "52.1" 20 +default_version "52.1"
21 21
22 source :url => "http://download.icu-project.org/files/icu4c/52.1/icu4c-52_1-src.tgz", 22 source :url => "http://download.icu-project.org/files/icu4c/52.1/icu4c-52_1-src.tgz",
23 :md5 => "9e96ed4c1d99c0d14ac03c140f9f346c" 23 :md5 => "9e96ed4c1d99c0d14ac03c140f9f346c"
config/software/libyaml.rb
@@ -1,63 +0,0 @@ @@ -1,63 +0,0 @@
1 -#  
2 -# Copyright:: Copyright (c) 2012-2014 Chef Software, Inc.  
3 -# Copyright:: Copyright (c) 2014 GitLab BV  
4 -# License:: Apache License, Version 2.0  
5 -#  
6 -# Licensed under the Apache License, Version 2.0 (the "License");  
7 -# you may not use this file except in compliance with the License.  
8 -# You may obtain a copy of the License at  
9 -#  
10 -# http://www.apache.org/licenses/LICENSE-2.0  
11 -#  
12 -# Unless required by applicable law or agreed to in writing, software  
13 -# distributed under the License is distributed on an "AS IS" BASIS,  
14 -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
15 -# See the License for the specific language governing permissions and  
16 -# limitations under the License.  
17 -#  
18 -  
19 -name "libyaml"  
20 -version '0.1.6'  
21 -  
22 -source :url => "http://pyyaml.org/download/libyaml/yaml-#{version}.tar.gz",  
23 - :md5 => '5fe00cda18ca5daeb43762b80c38e06e'  
24 -  
25 -relative_path "yaml-#{version}"  
26 -  
27 -configure_env =  
28 - case platform  
29 - when "aix"  
30 - {  
31 - "CC" => "xlc -q64",  
32 - "CXX" => "xlC -q64",  
33 - "LD" => "ld -b64",  
34 - "CFLAGS" => "-q64 -I#{install_dir}/embedded/include -O",  
35 - "LDFLAGS" => "-q64 -Wl,-blibpath:/usr/lib:/lib",  
36 - "OBJECT_MODE" => "64",  
37 - "ARFLAGS" => "-X64 cru",  
38 - "LD" => "ld -b64",  
39 - "OBJECT_MODE" => "64",  
40 - "ARFLAGS" => "-X64 cru "  
41 - }  
42 - when "mac_os_x"  
43 - {  
44 - "LDFLAGS" => "-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include",  
45 - "CFLAGS" => "-I#{install_dir}/embedded/include -L#{install_dir}/embedded/lib"  
46 - }  
47 - when "solaris2"  
48 - {  
49 - "LDFLAGS" => "-R#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include -static-libgcc",  
50 - "CFLAGS" => "-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include -DNO_VIZ"  
51 - }  
52 - else  
53 - {  
54 - "LDFLAGS" => "-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include",  
55 - "CFLAGS" => "-I#{install_dir}/embedded/include -L#{install_dir}/embedded/lib"  
56 - }  
57 - end  
58 -  
59 -build do  
60 - command "./configure --prefix=#{install_dir}/embedded", :env => configure_env  
61 - command "make -j #{max_build_jobs}", :env => configure_env  
62 - command "make -j #{max_build_jobs} install", :env => configure_env  
63 -end  
config/software/ruby.rb
@@ -1,158 +0,0 @@ @@ -1,158 +0,0 @@
1 -#  
2 -# Copyright:: Copyright (c) 2012 Opscode, Inc.  
3 -# License:: Apache License, Version 2.0  
4 -#  
5 -# Licensed under the Apache License, Version 2.0 (the "License");  
6 -# you may not use this file except in compliance with the License.  
7 -# You may obtain a copy of the License at  
8 -#  
9 -# http://www.apache.org/licenses/LICENSE-2.0  
10 -#  
11 -# Unless required by applicable law or agreed to in writing, software  
12 -# distributed under the License is distributed on an "AS IS" BASIS,  
13 -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
14 -# See the License for the specific language governing permissions and  
15 -# limitations under the License.  
16 -#  
17 -  
18 -name "ruby"  
19 -version "1.9.3-p484"  
20 -  
21 -dependency "zlib"  
22 -dependency "ncurses"  
23 -dependency "libedit"  
24 -dependency "openssl"  
25 -dependency "libyaml"  
26 -dependency "libiconv"  
27 -dependency "gdbm" if (platform == "mac_os_x" or platform == "freebsd" or platform == "aix")  
28 -dependency "libgcc" if (platform == "solaris2" and Omnibus.config.solaris_compiler == "gcc")  
29 -  
30 -source :url => "http://cache.ruby-lang.org/pub/ruby/1.9/ruby-#{version}.tar.gz",  
31 - :md5 => '8ac0dee72fe12d75c8b2d0ef5d0c2968'  
32 -  
33 -relative_path "ruby-#{version}"  
34 -  
35 -env =  
36 - case platform  
37 - when "mac_os_x"  
38 - {  
39 - "CFLAGS" => "-arch x86_64 -m64 -L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include -I#{install_dir}/embedded/include/ncurses -O3 -g -pipe",  
40 - "LDFLAGS" => "-arch x86_64 -R#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include -I#{install_dir}/embedded/include/ncurses"  
41 - }  
42 - when "solaris2"  
43 - if Omnibus.config.solaris_compiler == "studio"  
44 - {  
45 - "CFLAGS" => "-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include",  
46 - "LDFLAGS" => "-R#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include"  
47 - }  
48 - elsif Omnibus.config.solaris_compiler == "gcc"  
49 - {  
50 - "CFLAGS" => "-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include -O3 -g -pipe",  
51 - "LDFLAGS" => "-R#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include -static-libgcc",  
52 - "LD_OPTIONS" => "-R#{install_dir}/embedded/lib"  
53 - }  
54 - else  
55 - raise "Sorry, #{Omnibus.config.solaris_compiler} is not a valid compiler selection."  
56 - end  
57 - when "aix"  
58 - {  
59 - # see http://www.ibm.com/developerworks/aix/library/au-gnu.html  
60 - #  
61 - # specifically:  
62 - #  
63 - # "To use AIX run-time linking, you should create the shared object  
64 - # using gcc -shared -Wl,-G and create executables using the library  
65 - # by adding the -Wl,-brtl option to the link line. Technically, you  
66 - # can leave off the -shared option, but it does no harm and reduces  
67 - # confusion."  
68 - #  
69 - # AIX also uses -Wl,-blibpath instead of -R or LD_RUN_PATH, but the  
70 - # option is not additive, so requires /usr/lib and /lib as well (there  
71 - # is a -bsvr4 option to allow ld to take an -R flag in addition  
72 - # to turning on -brtl, but it had other side effects I couldn't fix).  
73 - #  
74 - # If libraries linked with gcc -shared have symbol resolution failures  
75 - # then it may be useful to add -bexpfull to export all symbols.  
76 - #  
77 - # -O2 optimized away some configure test which caused ext libs to fail  
78 - #  
79 - # We also need prezl's M4 instead of picking up /usr/bin/m4 which  
80 - # barfs on ruby.  
81 - #  
82 - "CC" => "xlc -q64",  
83 - "CXX" => "xlC -q64",  
84 - "LD" => "ld -b64",  
85 - "CFLAGS" => "-q64 -O -qhot -I#{install_dir}/embedded/include",  
86 - "CXXFLAGS" => "-q64 -O -qhot -I#{install_dir}/embedded/include",  
87 - "LDFLAGS" => "-q64 -L#{install_dir}/embedded/lib -Wl,-brtl -Wl,-blibpath:#{install_dir}/embedded/lib:/usr/lib:/lib",  
88 - "OBJECT_MODE" => "64",  
89 - "ARFLAGS" => "-X64 cru",  
90 - "M4" => "/opt/freeware/bin/m4",  
91 - "warnflags" => "-qinfo=por"  
92 - }  
93 - else  
94 - {  
95 - "CFLAGS" => "-I#{install_dir}/embedded/include -O3 -g -pipe",  
96 - "LDFLAGS" => "-Wl,-rpath,#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib"  
97 - }  
98 - end  
99 -  
100 -build do  
101 - configure_command = ["./configure",  
102 - "--prefix=#{install_dir}/embedded",  
103 - "--with-out-ext=fiddle",  
104 - "--enable-shared",  
105 - "--enable-libedit",  
106 - "--with-ext=psych",  
107 - "--disable-install-doc"]  
108 -  
109 - case platform  
110 - when "aix"  
111 - patch :source => "ruby-aix-configure.patch", :plevel => 1  
112 - patch :source => "ruby_aix_1_9_3_448_ssl_EAGAIN.patch", :plevel => 1  
113 - # --with-opt-dir causes ruby to send bogus commands to the AIX linker  
114 - when "freebsd"  
115 - configure_command << "--without-execinfo"  
116 - configure_command << "--with-opt-dir=#{install_dir}/embedded"  
117 - when "smartos"  
118 - # Opscode patch - someara@opscode.com  
119 - # GCC 4.7.0 chokes on mismatched function types between OpenSSL 1.0.1c and Ruby 1.9.3-p286  
120 - patch :source => "ruby-openssl-1.0.1c.patch", :plevel => 1  
121 -  
122 - # Patches taken from RVM.  
123 - # http://bugs.ruby-lang.org/issues/5384  
124 - # https://www.illumos.org/issues/1587  
125 - # https://github.com/wayneeseguin/rvm/issues/719  
126 - patch :source => "rvm-cflags.patch", :plevel => 1  
127 -  
128 - # From RVM forum  
129 - # https://github.com/wayneeseguin/rvm/commit/86766534fcc26f4582f23842a4d3789707ce6b96  
130 - configure_command << "ac_cv_func_dl_iterate_phdr=no"  
131 - configure_command << "--with-opt-dir=#{install_dir}/embedded"  
132 - else  
133 - configure_command << "--with-opt-dir=#{install_dir}/embedded"  
134 - end  
135 -  
136 - # @todo expose bundle_bust() in the DSL  
137 - env.merge!({  
138 - "RUBYOPT" => nil,  
139 - "BUNDLE_BIN_PATH" => nil,  
140 - "BUNDLE_GEMFILE" => nil,  
141 - "GEM_PATH" => nil,  
142 - "GEM_HOME" => nil  
143 - })  
144 -  
145 - # @todo: move into omnibus-ruby  
146 - has_gmake = system("gmake --version")  
147 -  
148 - if has_gmake  
149 - env.merge!({'MAKE' => 'gmake'})  
150 - make_binary = 'gmake'  
151 - else  
152 - make_binary = 'make'  
153 - end  
154 -  
155 - command configure_command.join(" "), :env => env  
156 - command "#{make_binary} -j #{max_build_jobs}", :env => env  
157 - command "#{make_binary} -j #{max_build_jobs} install", :env => env  
158 -end  
config/software/runit.rb 0 → 100644
@@ -0,0 +1,116 @@ @@ -0,0 +1,116 @@
  1 +#
  2 +# Copyright:: Copyright (c) 2012-2014 Chef Software, Inc.
  3 +# Copyright:: Copyright (c) 2014 GitLab.com
  4 +# License:: Apache License, Version 2.0
  5 +#
  6 +# Licensed under the Apache License, Version 2.0 (the "License");
  7 +# you may not use this file except in compliance with the License.
  8 +# You may obtain a copy of the License at
  9 +#
  10 +# http://www.apache.org/licenses/LICENSE-2.0
  11 +#
  12 +# Unless required by applicable law or agreed to in writing, software
  13 +# distributed under the License is distributed on an "AS IS" BASIS,
  14 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15 +# See the License for the specific language governing permissions and
  16 +# limitations under the License.
  17 +#
  18 +
  19 +name "runit"
  20 +default_version "2.1.1"
  21 +
  22 +source :url => "http://smarden.org/runit/runit-2.1.1.tar.gz",
  23 + :md5 => "8fa53ea8f71d88da9503f62793336bc3"
  24 +
  25 +relative_path "admin"
  26 +
  27 +working_dir = "#{project_dir}/runit-2.1.1"
  28 +
  29 +build do
  30 + # put runit where we want it, not where they tell us to
  31 + command 'sed -i -e "s/^char\ \*varservice\ \=\"\/service\/\";$/char\ \*varservice\ \=\"' + project.install_path.gsub("/", "\\/") + '\/service\/\";/" src/sv.c', :cwd => working_dir
  32 + # TODO: the following is not idempotent
  33 + command "sed -i -e s:-static:: src/Makefile", :cwd => working_dir
  34 +
  35 + # build it
  36 + command "make", :cwd => "#{working_dir}/src"
  37 + command "make check", :cwd => "#{working_dir}/src"
  38 +
  39 + # move it
  40 + command "mkdir -p #{install_dir}/embedded/bin"
  41 + ["src/chpst",
  42 + "src/runit",
  43 + "src/runit-init",
  44 + "src/runsv",
  45 + "src/runsvchdir",
  46 + "src/runsvdir",
  47 + "src/sv",
  48 + "src/svlogd",
  49 + "src/utmpset"].each do |bin|
  50 + command "cp #{bin} #{install_dir}/embedded/bin", :cwd => working_dir
  51 + end
  52 +
  53 + block do
  54 + install_path = self.project.install_path
  55 + open("#{install_dir}/embedded/bin/runsvdir-start", "w") do |file|
  56 + file.print <<-EOH
  57 +#!/bin/bash
  58 +#
  59 +# Copyright:: Copyright (c) 2012-2014 Chef Software, Inc.
  60 +# License:: Apache License, Version 2.0
  61 +#
  62 +# Licensed under the Apache License, Version 2.0 (the "License");
  63 +# you may not use this file except in compliance with the License.
  64 +# You may obtain a copy of the License at
  65 +#
  66 +# http://www.apache.org/licenses/LICENSE-2.0
  67 +#
  68 +# Unless required by applicable law or agreed to in writing, software
  69 +# distributed under the License is distributed on an "AS IS" BASIS,
  70 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  71 +# See the License for the specific language governing permissions and
  72 +# limitations under the License.
  73 +#
  74 +
  75 +PATH=#{install_path}/bin:#{install_path}/embedded/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
  76 +
  77 +# enforce our own ulimits
  78 +
  79 +ulimit -c 0
  80 +ulimit -d unlimited
  81 +ulimit -e 0
  82 +ulimit -f unlimited
  83 +ulimit -i 62793
  84 +ulimit -l 64
  85 +ulimit -m unlimited
  86 +# WARNING: increasing the global file descriptor limit increases RAM consumption on startup dramatically
  87 +ulimit -n 50000
  88 +ulimit -q 819200
  89 +ulimit -r 0
  90 +ulimit -s 10240
  91 +ulimit -t unlimited
  92 +ulimit -u unlimited
  93 +ulimit -v unlimited
  94 +ulimit -x unlimited
  95 +echo "1000000" > /proc/sys/fs/file-max
  96 +
  97 +# and our ulimit
  98 +
  99 +umask 022
  100 +
  101 +exec env - PATH=$PATH \
  102 +runsvdir -P #{install_path}/service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
  103 + EOH
  104 + end
  105 + end
  106 +
  107 + command "chmod 755 #{install_dir}/embedded/bin/runsvdir-start"
  108 +
  109 + # set up service directories
  110 + ["#{install_dir}/service",
  111 + "#{install_dir}/sv",
  112 + "#{install_dir}/init"].each do |dir|
  113 + command "mkdir -p #{dir}"
  114 + command "touch #{dir}/.gitkeep"
  115 + end
  116 +end
files/gitlab-cookbooks/gitlab/templates/default/nginx.conf.erb
1 user <%= node['gitlab']['user']['username'] %> <%= node['gitlab']['user']['username']%>; 1 user <%= node['gitlab']['user']['username'] %> <%= node['gitlab']['user']['username']%>;
2 worker_processes <%= @worker_processes %>; 2 worker_processes <%= @worker_processes %>;
3 error_log /var/log/gitlab/nginx/error.log; 3 error_log /var/log/gitlab/nginx/error.log;
  4 +pid /var/opt/gitlab/nginx/nginx.pid;
4 5
5 daemon off; 6 daemon off;
6 7