Commit aaf47c7b authored by Stan Hu's avatar Stan Hu Committed by Robert Speicher

Add support for running GitLab Geo tracking database

See gitlab-ee!1197
parent d1e3b49e
......@@ -9,13 +9,14 @@ postgres_bin_dir = $(shell pg_config --bindir)
postgres_replication_user = gitlab_replication
postgres_dir = $(realpath ./postgresql)
postgres_replica_dir = $(realpath ./postgresql-replica)
postgres_geo_dir = $(realpath ./postgresql-geo)
port = $(shell cat port 2>/dev/null)
username = $(shell whoami)
sshd_bin = $(shell which sshd)
git_bin = $(shell which git)
webpack_port = $(shell cat webpack_port 2>/dev/null || echo '3808')
all: gitlab-setup gitlab-shell-setup gitlab-workhorse-setup support-setup gitaly-setup
all: gitlab-setup gitlab-shell-setup gitlab-workhorse-setup support-setup gitaly-setup geo-setup
# Set up the GitLab Rails app
......@@ -187,6 +188,19 @@ postgresql-replication/backup:
postgresql-replication/config:
./support/postgres-replication ${postgres_dir}
# Setup GitLab Geo databases
.PHONY: geo-setup
geo-setup: gitlab/config/database_geo.yml postgresql/geo postgresql-replication/cluster postgresql-replication/role postgresql-replication/backup
gitlab/config/database_geo.yml:
sed "s|/home/git|${gitlab_development_root}|" database_geo.yml.example > gitlab/config/database_geo.yml
postgresql/geo:
${postgres_bin_dir}/initdb --locale=C -E utf-8 postgresql-geo/data
grep '^postgresql-geo:' Procfile || (printf ',s/^#postgresql-geo/postgresql/\nwq\n' | ed -s Procfile)
support/bootstrap-geo
.PHONY: foreman
foreman:
command -v $@ > /dev/null || gem install $@
......
......@@ -5,6 +5,7 @@
redis: exec redis-server /home/git/redis/redis.conf
postgresql: exec support/postgresql-signal-wrapper postgres -D /home/git/postgresql/data -k /home/git/postgresql -h ''
#postgresql-replica: exec support/postgresql-signal-wrapper postgres -D /home/git/postgresql-replica/data -k /home/git/postgresql-replica -h ''
#postgresql-geo: exec support/postgresql-signal-wrapper postgres -D /home/git/postgresql-geo/data -k /home/git/postgresql-geo -h ''
#openldap: exec support/exec-cd gitlab-openldap libexec/slapd -F slapd.d -d2 -h "ldap://$host:3890"
gitlab-workhorse: exec /usr/bin/env PATH="/home/git/gitlab-workhorse/bin:$PATH" gitlab-workhorse -authSocket /home/git/gitlab.socket -listenAddr $host:$port -documentRoot /home/git/gitlab/public -developmentMode -secretPath /home/git/gitlab/.gitlab_workhorse_secret -config /home/git/gitlab-workhorse/config.toml
rails-web: exec /usr/bin/env RAILS_ENV=development support/exec-cd gitlab bin/web start_foreground
......
development:
adapter: postgresql
encoding: unicode
database: gitlabhq_geo_development
pool: 5
host: /home/git/postgresql
test: &test
adapter: postgresql
encoding: unicode
database: gitlabhq_geo_test
pool: 5
host: /home/git/postgresql
......@@ -53,6 +53,10 @@ db() {
foreman_start -c all=0,redis=1,postgresql=1,openldap=1,influxdb=1,webpack=1
}
geo_db() {
foreman_start -c all=0,postgresql-geo=1
}
app() {
print_port
foreman_start -c all=0,rails-web=1,rails-background-jobs=1,gitlab-workhorse=1,nginx=1,grafana=1,sshd=1,gitaly=1
......@@ -75,6 +79,9 @@ case "x$1" in
xdb)
db
;;
xgeo_db)
geo_db
;;
xapp)
app
;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment