gitlab-qa 6.21.3 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +3 -2
  3. data/docs/configuring_omnibus.md +208 -0
  4. data/docs/run_qa_against_gdk.md +4 -0
  5. data/docs/what_tests_can_be_run.md +34 -0
  6. data/gitlab-qa.gemspec +1 -1
  7. data/lib/gitlab/qa.rb +7 -0
  8. data/lib/gitlab/qa/component/gitlab.rb +37 -30
  9. data/lib/gitlab/qa/component/minio.rb +2 -10
  10. data/lib/gitlab/qa/component/specs.rb +10 -9
  11. data/lib/gitlab/qa/docker/engine.rb +36 -5
  12. data/lib/gitlab/qa/report/test_result.rb +5 -1
  13. data/lib/gitlab/qa/runner.rb +57 -5
  14. data/lib/gitlab/qa/runtime/env.rb +6 -0
  15. data/lib/gitlab/qa/runtime/omnibus_configuration.rb +69 -0
  16. data/lib/gitlab/qa/runtime/omnibus_configurations/default.rb +25 -0
  17. data/lib/gitlab/qa/runtime/omnibus_configurations/object_storage.rb +48 -0
  18. data/lib/gitlab/qa/runtime/omnibus_configurations/packages.rb +17 -0
  19. data/lib/gitlab/qa/scenario/cli_commands.rb +3 -3
  20. data/lib/gitlab/qa/scenario/test/instance/relative_url.rb +1 -3
  21. data/lib/gitlab/qa/scenario/test/instance/repository_storage.rb +1 -1
  22. data/lib/gitlab/qa/scenario/test/integration/actioncable.rb +1 -3
  23. data/lib/gitlab/qa/scenario/test/integration/geo.rb +4 -5
  24. data/lib/gitlab/qa/scenario/test/integration/gitaly_cluster.rb +3 -3
  25. data/lib/gitlab/qa/scenario/test/integration/group_saml.rb +1 -1
  26. data/lib/gitlab/qa/scenario/test/integration/instance_saml.rb +1 -1
  27. data/lib/gitlab/qa/scenario/test/integration/kubernetes.rb +1 -1
  28. data/lib/gitlab/qa/scenario/test/integration/ldap_no_server.rb +1 -1
  29. data/lib/gitlab/qa/scenario/test/integration/ldap_no_tls.rb +1 -1
  30. data/lib/gitlab/qa/scenario/test/integration/ldap_tls.rb +1 -2
  31. data/lib/gitlab/qa/scenario/test/integration/mattermost.rb +1 -1
  32. data/lib/gitlab/qa/scenario/test/integration/mtls.rb +3 -7
  33. data/lib/gitlab/qa/scenario/test/integration/smtp.rb +1 -1
  34. data/lib/gitlab/qa/scenario/test/integration/ssh_tunnel.rb +1 -1
  35. data/lib/gitlab/qa/version.rb +1 -1
  36. data/tls_certificates/authority/ca.crt +32 -0
  37. data/tls_certificates/authority/ca.key +51 -0
  38. data/tls_certificates/authority/ca.pem +83 -0
  39. data/tls_certificates/gitaly/gitaly.test.crt +30 -0
  40. data/tls_certificates/gitaly/gitaly.test.csr +28 -0
  41. data/tls_certificates/gitaly/gitaly.test.key +51 -0
  42. data/tls_certificates/gitlab/gitlab.test.crt +28 -29
  43. data/tls_certificates/gitlab/gitlab.test.csr +28 -0
  44. data/tls_certificates/gitlab/gitlab.test.key +51 -52
  45. metadata +16 -10
  46. data/lib/gitlab/qa/scenario/test/integration/object_storage.rb +0 -64
  47. data/lib/gitlab/qa/scenario/test/integration/packages.rb +0 -36
  48. data/tls_certificates/gitaly/ssl/gitaly.test.crt +0 -33
  49. data/tls_certificates/gitaly/ssl/gitaly.test.key +0 -52
  50. data/tls_certificates/gitaly/trusted-certs/gitaly.test.crt +0 -33
  51. data/tls_certificates/gitaly/trusted-certs/gitlab.test.crt +0 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b108747b63e44e62bb63b71823e9612f8e32d652713bea427495a2139b61033
4
- data.tar.gz: 75b2b9a6ea4ead609c242046b621d4360d192bb9bd8b4da50df8e90a62b38adf
3
+ metadata.gz: ce83d37d177260e577ff1ffbc8e606eab4bc449953d8fc9de669404371433014
4
+ data.tar.gz: ef2a8ba114e9799c4d8b4cc71f3c098ac708b79e8573486305b9802d6bdf1826
5
5
  SHA512:
6
- metadata.gz: 83abd37be38747a36a6c96b23af631df6b878ccc70ac1d2a496acd04dfdef8eb99fd8afc148935269b86b6ba937037b58003f0f53fd979404df76343f15f3d1d
7
- data.tar.gz: 996f450bafb008395fbbb6f46afc9d12f6a7ac07d4451a039c57959e983c6eb6b77230144be052e16064990105611af713e2e166f69aa2392eccb3b048e32ed7
6
+ metadata.gz: 22d88835fee7158e9e5829e5d5e415abfa85d157148514c21eb904eecf69a8e8c4a49dc6e3aaae0e35824fc8f3a2be2d0c983f2f8057c915bcd0332a2fbea41f
7
+ data.tar.gz: 6e8007813c6258741ba516b011b8a5fc7efa1ee1ada5c385580477a18b02c35ac8e232370a80395fd3259f98058abaaffe11941c7ec9f8108a19dd36aafa4df3
data/.gitlab-ci.yml CHANGED
@@ -12,13 +12,14 @@ default:
12
12
  cache:
13
13
  key:
14
14
  files:
15
- - Gemfile
15
+ - Gemfile.lock
16
16
  - gitlab-qa.gemspec
17
17
  paths:
18
18
  - vendor/ruby
19
19
  before_script:
20
20
  - bundle version
21
- - bundle install --clean --jobs=$(nproc) --path=vendor --retry=3 --quiet && bundle check
21
+ - bundle config path vendor
22
+ - bundle install --jobs=$(nproc) --retry=3 --quiet && bundle check
22
23
  - if [ -n "$TRIGGERED_USER" ] && [ -n "$TRIGGER_SOURCE" ]; then
23
24
  echo "Pipeline triggered by $TRIGGERED_USER at $TRIGGER_SOURCE";
24
25
  fi
@@ -0,0 +1,208 @@
1
+ # Configuring Omnibus
2
+
3
+ Omnibus will, by default, contain the configuration specified in `Gitlab::QA::Runtime::OmnibusConfigurations::Default`.
4
+
5
+ Omnibus can be configured from two places:
6
+
7
+ 1. Within a custom `Scenario::Template`.
8
+ 1. Represented as a `Gitlab::QA::Runtime::OmnibusConfiguration` class.
9
+
10
+ ## Adding an Omnibus Configurator
11
+
12
+ All configurators are held within `Gitlab::QA::Runtime::OmnibusConfigurations` and represented as separate classes.
13
+
14
+ Notes:
15
+
16
+ - If it is required that more than one GitLab instance is configured,
17
+ you may skip adding an Omnibus Configurator. In this case, it should be handled by a separate `Scenario::Template`.
18
+ An example of this would be a Geo Primary and Secondary.
19
+ - All classes should be a type of `Runtime::OmnibusConfiguration`.
20
+
21
+ ### Add the Configurator Class
22
+
23
+ Create a new file in `lib/gitlab/qa/runtime/omnibus_configurations` called `registry.rb`.
24
+
25
+ ```ruby
26
+ # frozen_string_literal: true
27
+
28
+ module Gitlab
29
+ module QA
30
+ module Runtime
31
+ module OmnibusConfigurations
32
+ class Registry < Default
33
+ def configuration
34
+ <<~OMNIBUS
35
+ gitlab_rails['registry_enabled'] = true
36
+ OMNIBUS
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ ```
44
+
45
+ Notes:
46
+
47
+ - Refrain from adding unnecessary statement terminations (`;`).
48
+
49
+ ### Prepare Sidecar Container
50
+
51
+ If the tests require an additional container to be spun up adjacent to GitLab, you may override the `prepare` method.
52
+
53
+ ```ruby
54
+ #=> lib/gitlab/qa/runtime/omnibus_configurations/registry.rb
55
+
56
+ # frozen_string_literal: true
57
+
58
+ module Gitlab
59
+ module QA
60
+ module Runtime
61
+ module OmnibusConfigurations
62
+ class Registry < Default
63
+ def configuration
64
+ <<~OMNIBUS
65
+ gitlab_rails['registry_enabled'] = true
66
+ OMNIBUS
67
+ end
68
+
69
+ def prepare
70
+ Component::Sidecar.new
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+ ```
78
+
79
+ Notes:
80
+
81
+ - `prepare` **must** return an instance of `Component::Base`.
82
+ - The sidecar container will be prepared before the test runs, and will run the tests after it is running.
83
+ - Extending the class from `Default` is only a nicety that adds a singleton method called `Registry.configuration` and returns the configuration.
84
+ It is recommended to extend from `Default`, but you may also extend from any other Omnibus Configuration class, including `Runtime::OmnibusConfiguration`.
85
+
86
+ ## Running tests with Omnibus Configured
87
+
88
+ All Omnibus Configurators can be called by passing arguments into the `gitlab-qa` executable.
89
+
90
+ ```shell
91
+ exe/gitlab-qa Test::Instance::Image EE --omnibus-config registry
92
+ ```
93
+
94
+ Notes:
95
+
96
+ - `--omnibus-config registry` must match the name of the Omnibus Configurator Class name (`Runtime::OmnibusConfigurations::Registry`), but lowercase.
97
+ - If the Configurator Class name contains several words, the argument will be named the same, but snake cased. E.g. `--omnibus-config some_class` matches `SomeClass`, `--omnibus-config some_other_class` matches `SomeOtherClass`.
98
+ - The Omnibus GitLab Instance will have the configuration from `Default` and `Registry` (in that order) put into `/etc/gitlab/gitlab.rb` and GitLab QA will proceed to run the tests.
99
+ - If a specified Omnibus Configuration does not exist, GitLab QA will raise an error and fail immediately.
100
+
101
+ ## Further reading
102
+
103
+ ### Multiple Configurators
104
+
105
+ Multiple Configurators may be specified and the order will be preserved in which the arguments were passed.
106
+
107
+ E.g., given the arguments:
108
+
109
+ ```
110
+ exe/gitlab-qa Test::Instance::Image EE --omnibus-config packages,registry
111
+ # or
112
+ exe/gitlab-qa Test::Instance::Image EE --omnibus-config packages --omnibus-config registry
113
+ ```
114
+
115
+ Omnibus will be configured in the order they appear.
116
+
117
+ ```ruby
118
+ # /etc/gitlab/gitlab.rb
119
+ #=> Runtime::OmnibusConfiguration::Default#configuration
120
+ #=> Runtime::OmnibusConfiguration::Packages#configuration
121
+ #=> Runtime::OmnibusConfiguration::Registry#configuration
122
+ ```
123
+
124
+ The order is also preserved for Sidecar containers. If the `Packages` and `Registry` Configurators each prepare a sidecar container, they will be spun up in order from first to last.
125
+
126
+ ### Adding one-off configurations
127
+
128
+ #### From a new Scenario::Template
129
+
130
+ If it is required to create a new `Scenario::Template`, you may add new Configurations to the respective GitLab Instances by invoking `omnibus_configuration#<<`
131
+
132
+ ```ruby
133
+ # Geo example
134
+
135
+ Component::Gitlab.perform do |primary|
136
+ primary.omnibus_configuration << <<~OMNIBUS
137
+ geo_primary_role['enable'] = true
138
+ OMNIBUS
139
+
140
+ primary.instance do
141
+ Component::Gitlab.perform do |secondary|
142
+ secondary.omnibus_configuration << <<~OMNIBUS
143
+ geo_secondary_role['enable'] = true
144
+ OMNIBUS
145
+ end
146
+ end
147
+ end
148
+ ```
149
+
150
+ Notes:
151
+
152
+ - The `primary` instance will be configured using the `Runtime::OmnibusConfigurations::Default` configuration, *then* `geo_primary_role['enable'] = true` will be affixed afterwards.
153
+ - The `secondary` instance will be configured using the `Runtime::OmnibusConfigurations::Default` configuration, *then* `geo_secondary_role['enable'] = true` will be affixed afterwards.
154
+
155
+ #### From Component::Gitlab
156
+
157
+ Any additional one-off configurations needing to be added may be directly appended to `@omnibus_configuration` as such:
158
+
159
+ ```ruby
160
+ disable_animations = true
161
+
162
+ @omnibus_configuration << "gitlab_rails['gitlab_disable_animations'] = true" if disable_animations
163
+ ```
164
+
165
+ This will add the specified configuration **after** what has already been specified beforehand (Configurators or Default configurations).
166
+
167
+ Note:
168
+
169
+ - If there is no issue appending this configuration to the **rest** of the GitLab Instances that might be spun up, you can add this
170
+ to the global Omnibus Configuration. E.g., use `Runtime::Scenario.omnibus_configuration << ...` instead of `@omnibus_configuration << ...`
171
+
172
+ #### Difference between Runtime::Scenario.omnibus_configuration and Gitlab#omnibus_configuration
173
+
174
+ Generally, while running GitLab QA, only one GitLab instance is necessary. `Runtime::Scenario.omnibus_configuration` contains all of the global
175
+ Omnibus configurations required for this one environment. This also contains the configuration for any other GitLab instance.
176
+
177
+ When multiple GitLab Instances are required, `@omnibus_configuration#<<` is preferred over `Runtime::Scenario.omnibus_configuration#<<` since the First Instance might require
178
+ one Omnibus configuration that might be unneccesary or Invalid for the Second Instance.
179
+
180
+ #### Load order and precedence
181
+
182
+ 1. `Runtime::OmnibusConfigurations::Default`
183
+ 1. `Runtime::OmnibusConfigurations::[A,B,...]` where `A` and `B` are Configurators specified through the positional arguments `--a --b`
184
+ 1. Custom written `Scenario::Template` (such as `Test::Integation::Geo`)
185
+ 1. `lib/gitlab/qa/component/gitlab.rb`
186
+
187
+ From top to bottom, configurations will be loaded and any configurations that are superceded, will take precedence over the one before it, and so on.
188
+
189
+ ### Executing arbitrary shell commands within the GitLab Instance
190
+
191
+ Sometimes it's necessary to execute arbitrary commands within the GitLab instance before the tests start.
192
+
193
+ You may specify these commands by overriding the `exec_commands` method within the Configurator.
194
+
195
+ ```ruby
196
+ class Registry < Default
197
+ def configuration
198
+ # configuration
199
+ end
200
+
201
+ def exec_commands
202
+ [
203
+ 'cp /etc/gitlab/gitlab.rb /etc/gitlab/gitlab.bak.rb',
204
+ 'rm /etc/gitlab/gitlab.bak.rb'
205
+ ]
206
+ end
207
+ end
208
+ ```
@@ -37,6 +37,10 @@ make a few changes to your `gdk/gitlab/config/gitlab.yml` file.
37
37
  # build the QA image first
38
38
  # In gdk/gitlab:
39
39
  $ docker build -t gitlab/gitlab-ce-qa:your-custom-tag --file ./qa/Dockerfile ./
40
+
41
+ # Note: You will also need a corresponding GitLab image.
42
+ # For example, if you haven't changed any application code (e.g., no new elements), you could tag the current nightly build:
43
+ $ docker tag gitlab/gitlab-ce:nightly gitlab/gitlab-ce:your-custom-tag
40
44
 
41
45
  # Then in gitlab-qa:
42
46
  $ exe/gitlab-qa Test::Instance::Any gitlab/gitlab-ce:your-custom-tag http://192.168.0.12:3000 -- qa/specs/features/browser_ui/1_manage/login/log_in_spec.rb
@@ -143,6 +143,40 @@ To run EE tests, the `EE_LICENSE` environment variable needs to be set:
143
143
 
144
144
  `$ export EE_LICENSE=$(cat /path/to/GitLab.gitlab_license)`
145
145
 
146
+ ## Specifying the GitLab QA image to use
147
+
148
+ By default, `gitlab-qa` infers the QA image to use based on the GitLab image.
149
+ For instance, if you run the following:
150
+
151
+ ```
152
+ $ gitlab-qa Test::Instance::Image gitlab/gitlab-ee:12.4.0-ee.0
153
+ ```
154
+
155
+ Then, `gitlab-qa` would infer `gitlab/gitlab-ee-qa:12.4.0-ee.0` as the QA image
156
+ based on the GitLab image (note the `-qa` suffix in the image name).
157
+
158
+ In some cases, you'll want to use a specific QA image instead of letting
159
+ `gitlab-qa` infer the QA image name from the GitLab image. Such cases can be
160
+ when you're doing local debugging/testing and you want to control the QA image
161
+ name, or in the CI where the QA image might be built by a project (e.g.
162
+ `gitlab-org/gitlab`, and the GitLab image might be built by another project
163
+ (e.g. `gitlab-org/omnibus-gitlab-mirror`).
164
+
165
+ To specify the QA image to use, pass the `--qa-image QA_IMAGE` option,
166
+ as follows:
167
+
168
+ ```
169
+ $ gitlab-qa Test::Instance::Image --qa-image registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:branch-name EE
170
+ ```
171
+
172
+ Additionally, setting the `$QA_IMAGE` environment variable achieve the same result,
173
+ without needing to pass the `--qa-image` option:
174
+
175
+ ```
176
+ $ export QA_IMAGE="registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:branch-name"
177
+ $ gitlab-qa Test::Instance::Image EE
178
+ ```
179
+
146
180
  ## Running a specific test (or set of tests)
147
181
 
148
182
  In most of the scenarios listed below, if you don't want to run all the tests
data/gitlab-qa.gemspec CHANGED
@@ -31,5 +31,5 @@ Gem::Specification.new do |spec|
31
31
  spec.add_runtime_dependency 'gitlab', '~> 4.16.1'
32
32
  spec.add_runtime_dependency 'http', '4.3.0'
33
33
  spec.add_runtime_dependency 'nokogiri', '~> 1.10'
34
- spec.add_runtime_dependency 'table_print', '1.5.6'
34
+ spec.add_runtime_dependency 'table_print', '1.5.7'
35
35
  end
data/lib/gitlab/qa.rb CHANGED
@@ -8,6 +8,13 @@ module Gitlab
8
8
  autoload :Env, 'gitlab/qa/runtime/env'
9
9
  autoload :Scenario, 'gitlab/qa/runtime/scenario'
10
10
  autoload :TokenFinder, 'gitlab/qa/runtime/token_finder'
11
+ autoload :OmnibusConfiguration, 'gitlab/qa/runtime/omnibus_configuration'
12
+
13
+ module OmnibusConfigurations
14
+ autoload :Default, 'gitlab/qa/runtime/omnibus_configurations/default'
15
+ autoload :Packages, 'gitlab/qa/runtime/omnibus_configurations/packages'
16
+ autoload :ObjectStorage, 'gitlab/qa/runtime/omnibus_configurations/object_storage'
17
+ end
11
18
  end
12
19
 
13
20
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'securerandom'
2
4
  require 'net/http'
3
5
  require 'uri'
@@ -10,38 +12,36 @@ module Gitlab
10
12
  class Gitlab < Base
11
13
  extend Forwardable
12
14
 
13
- attr_reader :release
14
- attr_accessor :tls, :disable_animations, :skip_availability_check, :runner_network
15
+ attr_reader :release, :omnibus_configuration
16
+ attr_accessor :tls, :skip_availability_check, :runner_network
15
17
  attr_writer :name, :relative_path
16
18
 
17
19
  def_delegators :release, :tag, :image, :edition
18
20
 
19
- GITLAB_CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates/gitlab'.freeze, __dir__)
20
- GITALY_CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates/gitaly/ssl'.freeze, __dir__)
21
- TRUSTED_CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates/gitaly/trusted-certs'.freeze, __dir__)
21
+ AUTHORITY_CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates/authority', __dir__)
22
+ GITLAB_CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates/gitlab', __dir__)
23
+ GITALY_CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates/gitaly', __dir__)
22
24
 
23
- SSL_PATH = '/etc/gitlab/ssl'.freeze
24
- TRUSTED_PATH = '/etc/gitlab/trusted-certs'.freeze
25
+ SSL_PATH = '/etc/gitlab/ssl'
26
+ TRUSTED_PATH = '/etc/gitlab/trusted-certs'
25
27
 
26
28
  def initialize
27
29
  super
28
30
 
29
- @disable_animations = true
30
31
  @skip_availability_check = false
31
32
 
32
33
  @volumes[GITLAB_CERTIFICATES_PATH] = SSL_PATH
34
+ @volumes[AUTHORITY_CERTIFICATES_PATH] = TRUSTED_PATH
33
35
 
34
- self.release = 'CE'
35
- end
36
+ @omnibus_configuration ||= OmnibusConfiguration.new
36
37
 
37
- def omnibus_config=(config)
38
- @environment['GITLAB_OMNIBUS_CONFIG'] = config.tr("\n", ' ')
38
+ self.release = 'CE'
39
39
  end
40
40
 
41
41
  def set_formless_login_token
42
42
  return if Runtime::Env.gitlab_qa_formless_login_token.to_s.strip.empty?
43
43
 
44
- @environment['GITLAB_OMNIBUS_CONFIG'] = "gitlab_rails['env'] = { 'GITLAB_QA_FORMLESS_LOGIN_TOKEN' => '#{Runtime::Env.gitlab_qa_formless_login_token}' }; #{@environment['GITLAB_OMNIBUS_CONFIG'] || ''}"
44
+ @omnibus_configuration << "gitlab_rails['env'] = { 'GITLAB_QA_FORMLESS_LOGIN_TOKEN' => '#{Runtime::Env.gitlab_qa_formless_login_token}' }"
45
45
  end
46
46
 
47
47
  def elastic_url=(url)
@@ -68,14 +68,9 @@ module Gitlab
68
68
  tls ? '443' : '80'
69
69
  end
70
70
 
71
- def mtls
71
+ def gitaly_tls
72
72
  @volumes.delete(GITLAB_CERTIFICATES_PATH)
73
73
  @volumes[GITALY_CERTIFICATES_PATH] = SSL_PATH
74
- set_trusted_certificates
75
- end
76
-
77
- def set_trusted_certificates
78
- @volumes[TRUSTED_CERTIFICATES_PATH] = TRUSTED_PATH
79
74
  end
80
75
 
81
76
  def relative_path
@@ -99,17 +94,7 @@ module Gitlab
99
94
  end
100
95
 
101
96
  def prepare_gitlab_omnibus_config
102
- setup_disable_animations if disable_animations
103
97
  set_formless_login_token
104
- setup_application_settings_cache_expiry
105
- end
106
-
107
- def setup_disable_animations
108
- @environment['GITLAB_OMNIBUS_CONFIG'] = "gitlab_rails['gitlab_disable_animations'] = true; #{@environment['GITLAB_OMNIBUS_CONFIG'] || ''}"
109
- end
110
-
111
- def setup_application_settings_cache_expiry
112
- @environment['GITLAB_OMNIBUS_CONFIG'] = "gitlab_rails['application_settings_cache_seconds'] = 0; #{@environment['GITLAB_OMNIBUS_CONFIG'] || ''}"
113
98
  end
114
99
 
115
100
  def start # rubocop:disable Metrics/AbcSize
@@ -139,6 +124,8 @@ module Gitlab
139
124
  end
140
125
 
141
126
  def reconfigure
127
+ setup_omnibus
128
+
142
129
  @docker.attach(name) do |line, wait|
143
130
  puts line
144
131
  # TODO, workaround which allows to detach from the container
@@ -150,7 +137,7 @@ module Gitlab
150
137
  def wait_until_ready
151
138
  return if skip_availability_check
152
139
 
153
- if Availability.new(name, relative_path: relative_path, scheme: scheme, protocol_port: port.to_i).check(300)
140
+ if Availability.new(name, relative_path: relative_path, scheme: scheme, protocol_port: port.to_i).check(Runtime::Env.gitlab_availability_timeout)
154
141
  sleep 12 # TODO, handle that better
155
142
  puts ' -> GitLab is available.'
156
143
  else
@@ -174,6 +161,12 @@ module Gitlab
174
161
  raise 'Please configure an instance first!' unless [name, release, network].all?
175
162
  end
176
163
 
164
+ def setup_omnibus
165
+ @docker.write_files(name) do |f|
166
+ f.write('/etc/gitlab/gitlab.rb', @omnibus_configuration.to_s)
167
+ end
168
+ end
169
+
177
170
  class Availability
178
171
  def initialize(name, relative_path: '', scheme: 'http', protocol_port: 80)
179
172
  @docker = Docker::Engine.new
@@ -213,6 +206,20 @@ module Gitlab
213
206
  @uri.scheme == 'https' ? { use_ssl: true, verify_mode: OpenSSL::SSL::VERIFY_NONE } : {}
214
207
  end
215
208
  end
209
+
210
+ class OmnibusConfiguration
211
+ def initialize
212
+ @config = Runtime::Scenario.attributes[:omnibus_configuration] || []
213
+ end
214
+
215
+ def <<(configuration)
216
+ @config << configuration
217
+ end
218
+
219
+ def to_s
220
+ @config.to_s
221
+ end
222
+ end
216
223
  end
217
224
  end
218
225
  end