gitlab-grack 2.0.0.pre → 2.0.0.rc1
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/.gitignore +22 -3
- data/Gemfile +2 -7
- data/Gemfile.lock +8 -17
- data/Makefile +153 -0
- data/Procfile.example +3 -0
- data/README.md +292 -95
- data/Vagrantfile +41 -0
- data/database.yml.example +13 -0
- data/gitlab-openldap/.gitignore +1 -0
- data/gitlab-openldap/Makefile +40 -0
- data/gitlab-openldap/README.md +60 -0
- data/gitlab-openldap/bootstrap.ldif +36 -0
- data/gitlab-openldap/frontend.alt.example.com.ldif +109 -0
- data/gitlab-openldap/frontend.example.com.ldif +109 -0
- data/gitlab-openldap/run-slapd +3 -0
- data/gitlab-openldap/run-slapd-alt +3 -0
- data/redis/redis.conf.example +2 -0
- data/redis/resque.yml.example +2 -0
- data/support/edit-gitlab.yml +11 -0
- metadata +29 -25
- data/.gitmodules +0 -3
- data/.travis.yml +0 -14
- data/CHANGELOG +0 -2
- data/Rakefile +0 -27
- data/examples/dispatch.fcgi +0 -9
- data/grack.gemspec +0 -20
- data/install.txt +0 -60
- data/lib/grack.rb +0 -5
- data/lib/grack/auth.rb +0 -37
- data/lib/grack/bundle.rb +0 -20
- data/lib/grack/server.rb +0 -324
- data/lib/grack/version.rb +0 -3
- data/tests/main_test.rb +0 -239
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e58169aa1a220e55b89a028ccd0f404da9724959
|
4
|
+
data.tar.gz: 2d6677fac1e708aad1fb9b635b429fedcdff2a2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04add40340ee6c556e435e3908c32bf38f19f4e503f04f44a61b6a1574addef1b0d768cfb2f257c5879549918cd1e15b4482bf1e63ba3a7e9d536f1767b6b66c
|
7
|
+
data.tar.gz: a87bdaac672b756b35aa7ea7e862c70b46ff0441a8d2cbb1c28604860ae3bae2190e41e4f199f67a47884014e8f656275b9f09a52e83300aa3536bb82a66a60f
|
data/.gitignore
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
gitlab-shell/
|
2
|
+
.ssh/
|
3
|
+
gitlab-satellites/
|
4
|
+
repositories/
|
5
|
+
gitlab/
|
6
|
+
gitlab-ci/
|
7
|
+
gitlab-runner/
|
8
|
+
Procfile
|
9
|
+
postgresql/data
|
10
|
+
postgresql/.s.*
|
11
|
+
redis/*.conf
|
12
|
+
.bundle/
|
13
|
+
gitlab-openldap/bin/
|
14
|
+
gitlab-openldap/etc/
|
15
|
+
gitlab-openldap/include/
|
16
|
+
gitlab-openldap/lib/
|
17
|
+
gitlab-openldap/libexec/
|
18
|
+
gitlab-openldap/openldap-2.4.40.tgz
|
19
|
+
gitlab-openldap/openldap-2.4.40/
|
20
|
+
gitlab-openldap/sbin/
|
21
|
+
gitlab-openldap/share/
|
22
|
+
.vagrant/
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,25 +1,16 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
gitlab-grack (1.0.1)
|
5
|
-
rack (~> 1.4.1)
|
6
|
-
|
7
1
|
GEM
|
8
2
|
remote: https://rubygems.org/
|
9
3
|
specs:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
4
|
+
dotenv (0.11.1)
|
5
|
+
dotenv-deployment (~> 0.0.2)
|
6
|
+
dotenv-deployment (0.0.2)
|
7
|
+
foreman (0.74.0)
|
8
|
+
dotenv (~> 0.11.1)
|
9
|
+
thor (~> 0.19.1)
|
10
|
+
thor (0.19.1)
|
17
11
|
|
18
12
|
PLATFORMS
|
19
13
|
ruby
|
20
14
|
|
21
15
|
DEPENDENCIES
|
22
|
-
|
23
|
-
mocha (~> 0.11)
|
24
|
-
rack-test
|
25
|
-
rake
|
16
|
+
foreman
|
data/Makefile
ADDED
@@ -0,0 +1,153 @@
|
|
1
|
+
gitlab_repo = https://gitlab.com/gitlab-org/gitlab-ce.git
|
2
|
+
gitlab_shell_repo = https://gitlab.com/gitlab-org/gitlab-shell.git
|
3
|
+
gitlab_ci_repo = https://gitlab.com/gitlab-org/gitlab-ci.git
|
4
|
+
gitlab_runner_repo = https://gitlab.com/gitlab-org/gitlab-ci-runner.git
|
5
|
+
gitlab_development_root = $(shell pwd)
|
6
|
+
postgres_bin_dir = $(shell pg_config --bindir)
|
7
|
+
|
8
|
+
all: gitlab-setup gitlab-shell-setup gitlab-ci-setup gitlab-runner-setup support-setup
|
9
|
+
|
10
|
+
# Set up the GitLab Rails app
|
11
|
+
|
12
|
+
gitlab-setup: gitlab/.git gitlab-config gitlab/.bundle
|
13
|
+
|
14
|
+
gitlab/.git:
|
15
|
+
git clone ${gitlab_repo} gitlab
|
16
|
+
|
17
|
+
gitlab-config: gitlab/config/gitlab.yml gitlab/config/database.yml gitlab/config/unicorn.rb gitlab/config/resque.yml
|
18
|
+
|
19
|
+
gitlab/config/gitlab.yml:
|
20
|
+
sed -e "s|/home/git|${gitlab_development_root}|"\
|
21
|
+
gitlab/config/gitlab.yml.example > gitlab/config/gitlab.yml
|
22
|
+
support/edit-gitlab.yml gitlab/config/gitlab.yml
|
23
|
+
|
24
|
+
gitlab/config/database.yml:
|
25
|
+
sed "s|/home/git|${gitlab_development_root}|" database.yml.example > gitlab/config/database.yml
|
26
|
+
|
27
|
+
gitlab/config/unicorn.rb:
|
28
|
+
cp gitlab/config/unicorn.rb.example.development gitlab/config/unicorn.rb
|
29
|
+
|
30
|
+
gitlab/config/resque.yml:
|
31
|
+
sed "s|/home/git|${gitlab_development_root}|" redis/resque.yml.example > $@
|
32
|
+
|
33
|
+
gitlab/.bundle:
|
34
|
+
cd ${gitlab_development_root}/gitlab && bundle install --without mysql production --jobs 4
|
35
|
+
|
36
|
+
# Set up gitlab-shell
|
37
|
+
|
38
|
+
gitlab-shell-setup: gitlab-shell/.git gitlab-shell/config.yml gitlab-shell/.bundle
|
39
|
+
|
40
|
+
gitlab-shell/.git:
|
41
|
+
git clone ${gitlab_shell_repo} gitlab-shell
|
42
|
+
|
43
|
+
gitlab-shell/config.yml:
|
44
|
+
sed -e "s|/home/git|${gitlab_development_root}|"\
|
45
|
+
-e "s|:8080/|:3000|"\
|
46
|
+
-e "s|/usr/bin/redis-cli|$(shell which redis-cli)|"\
|
47
|
+
-e "s|^ socket: .*| socket: ${gitlab_development_root}/redis/redis.socket|"\
|
48
|
+
gitlab-shell/config.yml.example > gitlab-shell/config.yml
|
49
|
+
|
50
|
+
gitlab-shell/.bundle:
|
51
|
+
cd ${gitlab_development_root}/gitlab-shell && bundle install --without production --jobs 4
|
52
|
+
|
53
|
+
# Set up gitlab-ci
|
54
|
+
gitlab-ci-setup: gitlab-ci/.git gitlab-ci-config gitlab-ci/.bundle
|
55
|
+
|
56
|
+
gitlab-ci/.git:
|
57
|
+
git clone ${gitlab_ci_repo} gitlab-ci
|
58
|
+
|
59
|
+
gitlab-ci-config: gitlab-ci/config/application.yml gitlab-ci/config/database.yml gitlab-ci/config/resque.yml gitlab-ci/config/unicorn.rb
|
60
|
+
|
61
|
+
gitlab-ci/config/application.yml:
|
62
|
+
cp gitlab-ci/config/application.yml.example.development $@
|
63
|
+
|
64
|
+
gitlab-ci/config/database.yml:
|
65
|
+
sed -e "s|gitlabhq|gitlabci|"\
|
66
|
+
-e "s|/home/git|${gitlab_development_root}|"\
|
67
|
+
database.yml.example > $@
|
68
|
+
|
69
|
+
gitlab-ci/config/resque.yml:
|
70
|
+
sed "s|/home/git|${gitlab_development_root}|" redis/resque.yml.example > $@
|
71
|
+
|
72
|
+
gitlab-ci/config/unicorn.rb:
|
73
|
+
cp gitlab-ci/config/unicorn.rb.example.development $@
|
74
|
+
|
75
|
+
gitlab-ci/.bundle:
|
76
|
+
cd ${gitlab_development_root}/gitlab-ci && bundle install --without mysql production --jobs 4
|
77
|
+
|
78
|
+
gitlab-ci-clean:
|
79
|
+
rm -rf gitlab-ci
|
80
|
+
|
81
|
+
# Set up gitlab-runner
|
82
|
+
gitlab-runner-setup: gitlab-runner/.git gitlab-runner/.bundle
|
83
|
+
|
84
|
+
gitlab-runner/.git:
|
85
|
+
git clone ${gitlab_runner_repo} gitlab-runner
|
86
|
+
|
87
|
+
gitlab-runner/.bundle:
|
88
|
+
cd ${gitlab_development_root}/gitlab-runner && bundle install --jobs 4
|
89
|
+
|
90
|
+
gitlab-runner-clean:
|
91
|
+
rm -rf gitlab-runner
|
92
|
+
|
93
|
+
# Update gitlab, gitlab-shell, gitlab-ci and gitlab-runner
|
94
|
+
|
95
|
+
update: gitlab-update gitlab-shell-update gitlab-ci-update gitlab-runner-update
|
96
|
+
|
97
|
+
gitlab-update: gitlab/.git/pull
|
98
|
+
cd ${gitlab_development_root}/gitlab && \
|
99
|
+
bundle install --without mysql production --jobs 4 && \
|
100
|
+
bundle exec rake db:migrate
|
101
|
+
|
102
|
+
gitlab-shell-update: gitlab-shell/.git/pull
|
103
|
+
cd ${gitlab_development_root}/gitlab-shell && \
|
104
|
+
bundle install --without production --jobs 4
|
105
|
+
|
106
|
+
gitlab-ci-update: gitlab-ci/.git/pull
|
107
|
+
cd ${gitlab_development_root}/gitlab-ci && \
|
108
|
+
bundle install --without mysql production --jobs 4 && \
|
109
|
+
bundle exec rake db:migrate
|
110
|
+
|
111
|
+
gitlab-runner-update: gitlab-runner/.git/pull
|
112
|
+
cd ${gitlab_development_root}/gitlab-runner && \
|
113
|
+
bundle install
|
114
|
+
|
115
|
+
gitlab/.git/pull:
|
116
|
+
cd ${gitlab_development_root}/gitlab && git pull --ff-only
|
117
|
+
|
118
|
+
gitlab-shell/.git/pull:
|
119
|
+
cd ${gitlab_development_root}/gitlab-shell && git pull --ff-only
|
120
|
+
|
121
|
+
gitlab-ci/.git/pull:
|
122
|
+
cd ${gitlab_development_root}/gitlab-ci && git pull --ff-only
|
123
|
+
|
124
|
+
gitlab-runner/.git/pull:
|
125
|
+
cd ${gitlab_development_root}/gitlab-runner && git pull --ff-only
|
126
|
+
|
127
|
+
# Set up supporting services
|
128
|
+
|
129
|
+
support-setup: Procfile redis postgresql .bundle
|
130
|
+
@echo ""
|
131
|
+
@echo "*********************************************"
|
132
|
+
@echo "************** Setup finished! **************"
|
133
|
+
@echo "*********************************************"
|
134
|
+
sed -n '/^### Post-installation/,/^END Post-installation/p' README.md
|
135
|
+
@echo "*********************************************"
|
136
|
+
|
137
|
+
Procfile:
|
138
|
+
sed -e "s|/home/git|${gitlab_development_root}|g"\
|
139
|
+
-e "s|postgres |${postgres_bin_dir}/postgres |"\
|
140
|
+
$@.example > $@
|
141
|
+
|
142
|
+
redis: redis/redis.conf
|
143
|
+
|
144
|
+
redis/redis.conf:
|
145
|
+
sed "s|/home/git|${gitlab_development_root}|" $@.example > $@
|
146
|
+
|
147
|
+
postgresql: postgresql/data/PG_VERSION
|
148
|
+
|
149
|
+
postgresql/data/PG_VERSION:
|
150
|
+
${postgres_bin_dir}/initdb -E utf-8 postgresql/data
|
151
|
+
|
152
|
+
.bundle:
|
153
|
+
bundle install --jobs 4
|
data/Procfile.example
ADDED
data/README.md
CHANGED
@@ -1,95 +1,292 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
1
|
+
# GitLab Development Kit
|
2
|
+
|
3
|
+
The GDK runs a GitLab development environment isolated in a directory.
|
4
|
+
This environemnt contains GitLab CE, CI and Runner.
|
5
|
+
This project uses Foreman to run dedicated Postgres and Redis processes for
|
6
|
+
GitLab development. All data is stored inside the gitlab-development-kit
|
7
|
+
directory. All connections to supporting services go through Unix domain
|
8
|
+
sockets to avoid port conflicts.
|
9
|
+
|
10
|
+
## Design goals
|
11
|
+
|
12
|
+
- Get the user started, do not try to take care of everything
|
13
|
+
- Run everything as your 'desktop' user on your development machine
|
14
|
+
- GitLab Development Kit itself does not run `sudo` commands
|
15
|
+
- It is OK to leave some things to the user (e.g. installing Ruby)
|
16
|
+
|
17
|
+
## Installation
|
18
|
+
|
19
|
+
The preferred way to use GitLab Development Kit is to install Ruby and dependencies on your 'native' OS.
|
20
|
+
We strongly recommend the native install since it is much faster that a virtualized one.
|
21
|
+
If you want to use [Vagrant](https://www.vagrantup.com/) instead please see [the instructions for our (experimental) Vagrantfile](#vagrant).
|
22
|
+
**DO NOT** run the installation as a root user
|
23
|
+
|
24
|
+
### Install dependencies
|
25
|
+
|
26
|
+
#### Prerequisites for all platforms
|
27
|
+
|
28
|
+
If you do not have the dependencies below you will experience strange errors during installation.
|
29
|
+
|
30
|
+
1. Ruby 2.1.5 with your method of choice (RVM, ruby-build, rbenv, chruby, etc.)
|
31
|
+
1. Bundler `gem install bundler`
|
32
|
+
|
33
|
+
#### OS X 10.9
|
34
|
+
|
35
|
+
```
|
36
|
+
brew tap homebrew/dupes
|
37
|
+
brew install redis postgresql phantomjs libiconv icu4c pkg-config cmake nodejs
|
38
|
+
bundle config build.nokogiri --with-iconv-dir=/usr/local/opt/libiconv
|
39
|
+
```
|
40
|
+
|
41
|
+
#### Ubuntu
|
42
|
+
|
43
|
+
```
|
44
|
+
sudo apt-get install postgresql libpq-dev phantomjs redis-server libicu-dev cmake g++ nodejs libkrb5-dev
|
45
|
+
```
|
46
|
+
|
47
|
+
#### Arch Linux
|
48
|
+
|
49
|
+
```
|
50
|
+
sudo pacman -S postgresql phantomjs redis postgresql-libs icu nodejs
|
51
|
+
```
|
52
|
+
|
53
|
+
#### Debian
|
54
|
+
|
55
|
+
Please contribute this by sending a merge request.
|
56
|
+
|
57
|
+
#### RedHat
|
58
|
+
|
59
|
+
Please contribute this by sending a merge request.
|
60
|
+
|
61
|
+
### Clone GitLab Development Kit repository
|
62
|
+
|
63
|
+
```
|
64
|
+
git clone https://gitlab.com/gitlab-org/gitlab-development-kit.git
|
65
|
+
cd gitlab-development-kit
|
66
|
+
```
|
67
|
+
|
68
|
+
### Install the repositories and gems
|
69
|
+
|
70
|
+
The Makefile will clone the repositories, install the Gem bundles and set up
|
71
|
+
basic configuration files.
|
72
|
+
|
73
|
+
```
|
74
|
+
# Clone the official repositories of gitlab and gitlab-shell
|
75
|
+
make
|
76
|
+
```
|
77
|
+
|
78
|
+
Alternatively, you can clone straight from your forked repositories or GitLab EE.
|
79
|
+
|
80
|
+
```
|
81
|
+
# Clone your own forked repositories
|
82
|
+
make gitlab_repo=git@gitlab.com:example/gitlab-ce.git gitlab_shell_repo=git@gitlab.com:example/gitlab-shell.git
|
83
|
+
```
|
84
|
+
|
85
|
+
### Post-installation
|
86
|
+
|
87
|
+
Start Redis and PostgreSQL by running the command below.
|
88
|
+
|
89
|
+
bundle exec foreman start
|
90
|
+
|
91
|
+
Seed the main GitLab database:
|
92
|
+
|
93
|
+
cd gitlab && bundle exec rake db:create dev:setup
|
94
|
+
|
95
|
+
Finally, start the main GitLab rails application:
|
96
|
+
|
97
|
+
bundle exec foreman start
|
98
|
+
|
99
|
+
Now you can go to http://localhost:3000 in your browser.
|
100
|
+
The development login credentials are `root` and `5iveL!fe`
|
101
|
+
|
102
|
+
If you want to work on GitLab CI, first seed the GitLab CI database:
|
103
|
+
|
104
|
+
cd gitlab-ci && bundle exec rake db:create db:setup
|
105
|
+
|
106
|
+
To start the GitLab CI rails application:
|
107
|
+
|
108
|
+
bundle exec foreman start
|
109
|
+
|
110
|
+
Setup the GitLab Runner:
|
111
|
+
|
112
|
+
cd gitlab-runner
|
113
|
+
CI_SERVER_URL=http://localhost:9000 bundle exec ./bin/setup
|
114
|
+
|
115
|
+
Start the GitLab Runner:
|
116
|
+
|
117
|
+
bundle exec ./bin/runner
|
118
|
+
|
119
|
+
To enable the OpenLDAP server, see the OpenLDAP instructions in this readme.
|
120
|
+
|
121
|
+
END Post-installation
|
122
|
+
|
123
|
+
Please do not delete the 'END Post-installation' line above. It is used to
|
124
|
+
print the post-installation message from the Makefile.
|
125
|
+
|
126
|
+
### Vagrant
|
127
|
+
|
128
|
+
[Vagrant](http://www.vagrantup.com) is a tool for setting up identical development
|
129
|
+
environments including all dependencies. Vagrant will default to using
|
130
|
+
[VirtualBox](http://www.virtualbox.org), but it has many plugins for different
|
131
|
+
environments.
|
132
|
+
|
133
|
+
Vagrant allows you to develop GitLab without affecting your host machine.
|
134
|
+
But we recommend developing GitLab on metal if you can.
|
135
|
+
Vagrant can be very slow since the NFS server is on the host OS.
|
136
|
+
And GitLab (testing) accesses a lot of files.
|
137
|
+
You can improve the speed by running NFS on the guest OS.
|
138
|
+
In this case you should take care to not lose the files when you shut down the VM.
|
139
|
+
|
140
|
+
Once you have Vagrant installed, simply type `vagrant up` in this directory. Vagrant
|
141
|
+
will download an OS image, bring it up, and install all the prerequisites. You then
|
142
|
+
type `vagrant ssh` to ssh into the box. This directory will be available as a shared
|
143
|
+
folder in `/vagrant/` and you can continue at *Install the repositories and gems*
|
144
|
+
below.
|
145
|
+
|
146
|
+
Typically you keep editing on the host machine but run `make`, `bundle exec` etc.
|
147
|
+
inside the `vagrant ssh` session.
|
148
|
+
|
149
|
+
Note: On some setups the shared folder will have the wrong user. This is detected
|
150
|
+
by the Vagrantfile and you should `sudo su - build` to switch to the correct user
|
151
|
+
in that case.
|
152
|
+
|
153
|
+
## Development
|
154
|
+
|
155
|
+
When doing development, you will need one shell session (terminal window)
|
156
|
+
running Postgres and Redis, and one or more other sessions to work on GitLab
|
157
|
+
itself.
|
158
|
+
|
159
|
+
### Example
|
160
|
+
|
161
|
+
First start Postgres and Redis.
|
162
|
+
|
163
|
+
```
|
164
|
+
# terminal window 1
|
165
|
+
# current directory: gitlab-development-kit
|
166
|
+
bundle exec foreman start
|
167
|
+
```
|
168
|
+
|
169
|
+
Next, start a Rails development server.
|
170
|
+
|
171
|
+
```
|
172
|
+
# terminal window 2
|
173
|
+
# current directory: gitlab-development-kit/gitlab
|
174
|
+
bundle exec foreman start
|
175
|
+
```
|
176
|
+
|
177
|
+
Now you can go to http://localhost:3000 in your browser.
|
178
|
+
The development login credentials are `root` and `5iveL!fe`
|
179
|
+
|
180
|
+
### Running the tests
|
181
|
+
|
182
|
+
In order to run the test you can use the following commands:
|
183
|
+
- `rake spinach` to run the spinach suite
|
184
|
+
- `rake spec` to run the rspec suite
|
185
|
+
- `rake jasmine:ci` to run the jasmine test suite
|
186
|
+
- `rake gitlab:test` to run all the tests
|
187
|
+
|
188
|
+
Note: You can't run `rspec .` since this will try to run all the `_spec.rb`
|
189
|
+
files it can find, also the ones in `/tmp`
|
190
|
+
|
191
|
+
To run a single test file you can use:
|
192
|
+
|
193
|
+
- `bundle exec rspec spec/controllers/commit_controller_spec.rb` for a rspec test
|
194
|
+
- `bundle exec spinach features/project/issues/milestones.feature` for a spinach test
|
195
|
+
|
196
|
+
## Update gitlab and gitlab-shell repositories
|
197
|
+
|
198
|
+
When working on a new feature, always check that your `gitlab` repository is up
|
199
|
+
to date with the upstream master branch.
|
200
|
+
|
201
|
+
In order to fetch the latest code, first make sure that `foreman` for
|
202
|
+
postgres is runnning (needed for db migration) and then run:
|
203
|
+
|
204
|
+
```
|
205
|
+
make update
|
206
|
+
```
|
207
|
+
|
208
|
+
This will update both `gitlab`, `gitlab-ci` and `gitlab-shell` and run any possible migrations.
|
209
|
+
You can also update them separately by running `make gitlab-update` `make gitlab-ci-update` and
|
210
|
+
`make gitlab-shell-update` respectively.
|
211
|
+
|
212
|
+
## OpenLDAP
|
213
|
+
|
214
|
+
To run the OpenLDAP installation included in the GitLab development kit do the following:
|
215
|
+
|
216
|
+
```
|
217
|
+
vim Procfile # remove the comment on the OpenLDAP line
|
218
|
+
cd gitlab-openldap
|
219
|
+
make # will setup the databases
|
220
|
+
```
|
221
|
+
|
222
|
+
in the gitlab repository edit config/gitlab.yml;
|
223
|
+
|
224
|
+
```yaml
|
225
|
+
ldap:
|
226
|
+
enabled: true
|
227
|
+
servers:
|
228
|
+
main:
|
229
|
+
label: LDAP
|
230
|
+
host: 127.0.0.1
|
231
|
+
port: 3890
|
232
|
+
uid: 'uid'
|
233
|
+
method: 'plain' # "tls" or "ssl" or "plain"
|
234
|
+
base: 'dc=example,dc=com'
|
235
|
+
user_filter: ''
|
236
|
+
group_base: 'ou=groups,dc=example,dc=com'
|
237
|
+
admin_group: ''
|
238
|
+
# Alternative server, multiple LDAP servers only work with GitLab-EE
|
239
|
+
# alt:
|
240
|
+
# label: LDAP-alt
|
241
|
+
# host: 127.0.0.1
|
242
|
+
# port: 3890
|
243
|
+
# uid: 'uid'
|
244
|
+
# method: 'plain' # "tls" or "ssl" or "plain"
|
245
|
+
# base: 'dc=example-alt,dc=com'
|
246
|
+
# user_filter: ''
|
247
|
+
# group_base: 'ou=groups,dc=example-alt,dc=com'
|
248
|
+
# admin_group: ''
|
249
|
+
```
|
250
|
+
|
251
|
+
The second database is optional, and will only work with Gitlab-EE.
|
252
|
+
|
253
|
+
## Troubleshooting
|
254
|
+
|
255
|
+
### Rails cannot connect to Postgres
|
256
|
+
|
257
|
+
- Check if foreman is running in the gitlab-development-kit directory.
|
258
|
+
- Check for custom Postgres connection settings defined via the environment; we
|
259
|
+
assume none such variables are set. Look for them with `set | grep '^PG'`.
|
260
|
+
|
261
|
+
### 'LoadError: dlopen' when starting Ruby apps
|
262
|
+
|
263
|
+
This can happen when you try to load a Ruby gem with native extensions that
|
264
|
+
were linked against a system library that is no longer there. A typical culprit
|
265
|
+
is Homebrew on OS X, which encourages frequent updates (`brew update && brew
|
266
|
+
upgrade`) which may break binary compatibility.
|
267
|
+
|
268
|
+
```
|
269
|
+
bundle exec rake db:create gitlab:setup
|
270
|
+
rake aborted!
|
271
|
+
LoadError: dlopen(/Users/janedoe/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/charlock_holmes-0.6.9.4/charlock_holmes/charlock_holmes.bundle, 9): Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.52.1.dylib
|
272
|
+
Referenced from: /Users/janedoe/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/charlock_holmes-0.6.9.4/charlock_holmes/charlock_holmes.bundle
|
273
|
+
Reason: image not found - /Users/janedoe/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/charlock_holmes-0.6.9.4/charlock_holmes/charlock_holmes.bundle
|
274
|
+
/Users/janedoe/gitlab-development-kit/gitlab/config/application.rb:6:in `<top (required)>'
|
275
|
+
/Users/janedoe/gitlab-development-kit/gitlab/Rakefile:5:in `require'
|
276
|
+
/Users/janedoe/gitlab-development-kit/gitlab/Rakefile:5:in `<top (required)>'
|
277
|
+
(See full trace by running task with --trace)
|
278
|
+
```
|
279
|
+
|
280
|
+
In the above example, you see that the charlock_holmes gem fails to load
|
281
|
+
`libicui18n.52.1.dylib`. You can try fixing this by re-installing
|
282
|
+
charlock_holmes:
|
283
|
+
|
284
|
+
```
|
285
|
+
# in /Users/janedoe/gitlab-development-kit
|
286
|
+
gem uninstall charlock_holmes
|
287
|
+
bundle install # should reinstall charlock_holmes
|
288
|
+
```
|
289
|
+
|
290
|
+
### Other problems
|
291
|
+
|
292
|
+
Please open an issue on the [GDK issue tracker](https://gitlab.com/gitlab-org/gitlab-development-kit/issues).
|