gitlab_config 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +40 -0
- data/lib/gitlab_config/configuration.rb +6 -0
- data/lib/gitlab_config/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9e8a7f0feb130c62f334db7d98dc7f8cb32ce3c
|
4
|
+
data.tar.gz: 9bda3ddaa74f48219e679dacc535fae80a3b12cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
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
|
+
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-
|
11
|
+
date: 2016-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|