Make host also customizable with file/environment variable

parent c9163294
......@@ -25,6 +25,7 @@ gitlab-openldap/share/
.vagrant/
gitlab-workhorse/
.vagrant_enabled
host
port
.ruby-version
localhost.*
......
......@@ -2,7 +2,7 @@ redis: redis-server /home/git/redis/redis.conf
postgresql: support/postgresql-signal-wrapper postgres -D /home/git/postgresql/data -k /home/git/postgresql -h ''
#postgresql-replica: support/postgresql-signal-wrapper postgres -D /home/git/postgresql-replica/data -k /home/git/postgresql-replica -h ''
#openldap: cd gitlab-openldap && libexec/slapd -F slapd.d -d2 -h "ldap://127.0.0.1:3890"
gitlab-workhorse: PATH=/home/git/gitlab-workhorse:$PATH gitlab-workhorse -authSocket /home/git/gitlab.socket -listenAddr localhost:$port -documentRoot /home/git/gitlab/public -developmentMode
gitlab-workhorse: PATH=/home/git/gitlab-workhorse:$PATH gitlab-workhorse -authSocket /home/git/gitlab.socket -listenAddr $host:$port -documentRoot /home/git/gitlab/public -developmentMode
rails-web: RAILS_ENV=development support/exec-cd gitlab bin/web start_foreground
rails-background-jobs: RAILS_ENV=development support/exec-cd gitlab bin/background_jobs start_foreground
#workhorse-stunnel: support/workhorse-stunnel localhost:3443 /home/git/gitlab.socket /home/git/localhost.pem
......
#!/bin/sh
# Try to read the gitlab-workhorse port from the environment
# Try to read the gitlab-workhorse host:port from the environments
if [ x$host = x ]; then
# Try a host file
host=$(cat host 2>/dev/null)
fi
if [ x$port = x ] ; then
# Try a port file
port=$(cat port 2>/dev/null)
fi
# Fall back to 3000
# Fall back to localhost:3000
host=${host:-localhost}
port=${port:-3000}
print_port() {
......@@ -35,13 +40,13 @@ print_port() {
"
echo
echo
echo "Starting GitLab in $(pwd) on port ${port}"
echo "Starting GitLab in $(pwd) on port ${host}:${port}"
echo
echo
}
foreman_start() {
exec env port=${port} foreman start "$@"
exec env port=${port} host=${host} foreman start "$@"
}
db() {
......
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