gitlab_config 0.4.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 844899bcb19e4dfb01e87f5cacc90a1207b33078
4
- data.tar.gz: 85c0e166229a48bec89dbe71bdedbea8f1583331
3
+ metadata.gz: e9e8a7f0feb130c62f334db7d98dc7f8cb32ce3c
4
+ data.tar.gz: 9bda3ddaa74f48219e679dacc535fae80a3b12cd
5
5
  SHA512:
6
- metadata.gz: ac349b07dc4032a1967c054a8a2ddff1451094d19fcb5fb1878c8f3bc9026211f0c8aeac3c76f304bf903fe58b9588d700dce6caf5cb030001386851a8070e77
7
- data.tar.gz: 49ea6eb76e9956de4239afa04749b6ca468f46f00957c51e6b82974eecefc0367473d6200986b276cc0131967800cd5f04c233dbcf0d665928668385b5666619
6
+ metadata.gz: 00c822864cb98f51de3e708baf4380d85537e6bb2474609db3aa00fff16ff0f349f51e69834f03b7f0f084749b364acbf91dc1191d8e9c75bc91b51fdaef5c71
7
+ data.tar.gz: 8e18af44055c747e974faf171f650031bde9199519c32755c9c44fa5a48718365044bb5f58998b0669cf18f2561c3dd326a9e095ea3bdaacd336f0b9de850bbe
data/README.md CHANGED
@@ -1 +1,41 @@
1
1
  # Gitlab Config
2
+
3
+ The Gitlab config gem can be used in `/etc/gitlab/gitlab.rb` to provide dynamic configuration options for Gitlab.
4
+
5
+ ## Installation
6
+
7
+ gem install gitlab_config
8
+
9
+ ## Example Use
10
+
11
+ ### Local Configuration
12
+
13
+ If you have a number of configuration files locally they can be loaded based on an environment variable.
14
+
15
+ ```YAML
16
+ # /opt/test_config.yml
17
+ gitlab_rails:
18
+ db_host: 'database.mygitlab.com'
19
+ db_username: 'gitlab'
20
+ db_password: 'apassword'
21
+ ```
22
+
23
+ Within your `/etc/gitlab/gitlab.yml` this could be use as follows:
24
+
25
+ ```ruby
26
+ require 'gitlab_config'
27
+
28
+ options = {
29
+ source: :local,
30
+ file: "/opt/#{ENV['avar']}_config.yml"
31
+ }
32
+
33
+ GitlabConfig.load_configuration(options) do |config|
34
+ config.fetch('gitlab_rails').each { |k, v| gitlab_rails[k] = v }
35
+ postgresql['enable'] = config.fetch('gitlab_rails').has_key? 'db_host'
36
+ end
37
+ ```
38
+
39
+ Here the options hash lists the source of the config as the local filesystem and the file key gives the path of the file using an environment variable. The load configuration block then takes the loaded configuration and applies to the `gitlab_rails` configuration object. You can also set other values like disabling the local database.
40
+
41
+
@@ -40,6 +40,12 @@ module GitlabConfig
40
40
  configuration['gitlab_rails']['backup_upload_connection']['aws_secret_access_key'] = iam.secret
41
41
  end
42
42
  end
43
+
44
+ if @options.has_key?(:key) && @options.has_key?(:secret)
45
+ configuration['gitlab_rails']['backup_upload_connection']['aws_access_key_id'] = @options.fetch(:key)
46
+ configuration['gitlab_rails']['backup_upload_connection']['aws_secret_access_key'] = @options.fetch(:secret)
47
+ end
48
+
43
49
  configuration
44
50
  end
45
51
 
@@ -1,3 +1,3 @@
1
1
  module GitlabConfig
2
- VERSION = "0.4.2"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Tarry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-07 00:00:00.000000000 Z
11
+ date: 2016-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk