gitlab-workhorse: upgrade to v.0.4.2

Module formerly known as gitlab-git-http-server
This commit is contained in:
Sameer Naik 2015-11-19 19:36:09 +05:30
parent 39409e3f5b
commit d98b93ffc1
7 changed files with 34 additions and 40 deletions

View File

@ -4,6 +4,7 @@ This file only reflects the changes that are made in this image. Please refer to
**latest**
- gitlab-shell: upgrade to v.2.6.7
- gitlab-workhorse: upgrade to v.0.4.2
**8.1.4**
- gitlab: upgrade to CE v8.1.4

View File

@ -3,7 +3,7 @@ MAINTAINER sameer@damagehead.com
ENV GITLAB_VERSION=8.1.4 \
GITLAB_SHELL_VERSION=2.6.7 \
GITLAB_GIT_HTTP_SERVER_VERSION=0.3.0 \
GITLAB_WORKHORSE_VERSION=0.4.2 \
GITLAB_USER="git" \
GITLAB_HOME="/home/git" \
GITLAB_LOG_DIR="/var/log/gitlab" \
@ -12,7 +12,7 @@ ENV GITLAB_VERSION=8.1.4 \
ENV GITLAB_INSTALL_DIR="${GITLAB_HOME}/gitlab" \
GITLAB_SHELL_INSTALL_DIR="${GITLAB_HOME}/gitlab-shell" \
GITLAB_GIT_HTTP_SERVER_INSTALL_DIR="${GITLAB_HOME}/gitlab-git-http-server" \
GITLAB_WORKHORSE_INSTALL_DIR="${GITLAB_HOME}/gitlab-workhorse" \
GITLAB_DATA_DIR="${GITLAB_HOME}/data" \
GITLAB_BUILD_DIR="${GITLAB_CACHE_DIR}/build" \
GITLAB_RUNTIME_DIR="${GITLAB_CACHE_DIR}/runtime"

View File

@ -49,11 +49,11 @@ cd ${GITLAB_SHELL_INSTALL_DIR}
exec_as_git cp -a ${GITLAB_SHELL_INSTALL_DIR}/config.yml.example ${GITLAB_SHELL_INSTALL_DIR}/config.yml
exec_as_git ./bin/install
echo "Cloning gitlab-git-http-server v.${GITLAB_GIT_HTTP_SERVER_VERSION}..."
exec_as_git git clone -q -b ${GITLAB_GIT_HTTP_SERVER_VERSION} --depth 1 \
https://gitlab.com/gitlab-org/gitlab-git-http-server.git ${GITLAB_GIT_HTTP_SERVER_INSTALL_DIR}
echo "Cloning gitlab-workhorse v.${GITLAB_WORKHORSE_VERSION}..."
exec_as_git git clone -q -b ${GITLAB_WORKHORSE_VERSION} --depth 1 \
https://gitlab.com/gitlab-org/gitlab-workhorse.git ${GITLAB_WORKHORSE_INSTALL_DIR}
cd ${GITLAB_GIT_HTTP_SERVER_INSTALL_DIR}
cd ${GITLAB_WORKHORSE_INSTALL_DIR}
exec_as_git make
# shallow clone gitlab-ce
@ -222,18 +222,17 @@ stdout_logfile=${GITLAB_LOG_DIR}/supervisor/%(program_name)s.log
stderr_logfile=${GITLAB_LOG_DIR}/supervisor/%(program_name)s.log
EOF
# configure supervisord to start gitlab-git-http-server
cat > /etc/supervisor/conf.d/gitlab-git-http-server.conf <<EOF
[program:gitlab-git-http-server]
# configure supervisord to start gitlab-workhorse
cat > /etc/supervisor/conf.d/gitlab-workhorse.conf <<EOF
[program:gitlab-workhorse]
priority=20
directory=${GITLAB_INSTALL_DIR}
environment=HOME=${GITLAB_HOME}
command=${GITLAB_GIT_HTTP_SERVER_INSTALL_DIR}/gitlab-git-http-server
command=${GITLAB_WORKHORSE_INSTALL_DIR}/gitlab-workhorse
-listenUmask 0
-listenNetwork unix
-listenAddr ${GITLAB_INSTALL_DIR}/tmp/sockets/gitlab-git-http-server.socket
-listenAddr ${GITLAB_INSTALL_DIR}/tmp/sockets/gitlab-workhorse.socket
-authBackend http://127.0.0.1:8080
{{GITLAB_REPOS_DIR}}
user=git
autostart=true
autorestart=true

View File

@ -38,8 +38,8 @@ upstream gitlab {
server unix:{{GITLAB_INSTALL_DIR}}/tmp/sockets/gitlab.socket fail_timeout=0;
}
upstream gitlab-git-http-server {
server unix:{{GITLAB_INSTALL_DIR}}/tmp/sockets/gitlab-git-http-server.socket fail_timeout=0;
upstream gitlab-workhorse {
server unix:{{GITLAB_INSTALL_DIR}}/tmp/sockets/gitlab-workhorse.socket fail_timeout=0;
}
## Normal HTTP host
@ -117,23 +117,23 @@ server {
}
location ~ ^{{GITLAB_RELATIVE_URL_ROOT__with_trailing_slash}}[\w\.-]+/[\w\.-]+/(info/refs|git-upload-pack|git-receive-pack)$ {
# 'Error' 418 is a hack to re-use the @gitlab-git-http-server block
try_files /nonexisting-file @gitlab-git-http-server;
# 'Error' 418 is a hack to re-use the @gitlab-workhorse block
try_files /nonexisting-file @gitlab-workhorse;
}
location ~ ^{{GITLAB_RELATIVE_URL_ROOT__with_trailing_slash}}[\w\.-]+/[\w\.-]+/repository/archive {
# 'Error' 418 is a hack to re-use the @gitlab-git-http-server block
error_page 418 = @gitlab-git-http-server;
# 'Error' 418 is a hack to re-use the @gitlab-workhorse block
error_page 418 = @gitlab-workhorse;
return 418;
}
location ~ ^{{GITLAB_RELATIVE_URL_ROOT__with_trailing_slash}}api/v3/projects/.*/repository/archive {
# 'Error' 418 is a hack to re-use the @gitlab-git-http-server block
error_page 418 = @gitlab-git-http-server;
# 'Error' 418 is a hack to re-use the @gitlab-workhorse block
error_page 418 = @gitlab-workhorse;
return 418;
}
location @gitlab-git-http-server {
location @gitlab-workhorse {
## If you use HTTPS make sure you disable gzip compression
## to be safe against BREACH attack.
# gzip off;
@ -150,7 +150,7 @@ server {
# The following settings only work with NGINX 1.7.11 or newer
#
# # Pass chunked request bodies to gitlab-git-http-server as-is
# # Pass chunked request bodies to gitlab-workhorse as-is
# proxy_request_buffering off;
# proxy_http_version 1.1;
@ -159,7 +159,7 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto {{NGINX_X_FORWARDED_PROTO}};
proxy_pass http://gitlab-git-http-server;
proxy_pass http://gitlab-workhorse;
}
## Enable gzip compression as per rails guide:

View File

@ -42,8 +42,8 @@ upstream gitlab {
server unix:{{GITLAB_INSTALL_DIR}}/tmp/sockets/gitlab.socket fail_timeout=0;
}
upstream gitlab-git-http-server {
server unix:{{GITLAB_INSTALL_DIR}}/tmp/sockets/gitlab-git-http-server.socket fail_timeout=0;
upstream gitlab-workhorse {
server unix:{{GITLAB_INSTALL_DIR}}/tmp/sockets/gitlab-workhorse.socket fail_timeout=0;
}
## Redirects all HTTP traffic to the HTTPS host
@ -167,23 +167,23 @@ server {
}
location ~ ^{{GITLAB_RELATIVE_URL_ROOT__with_trailing_slash}}[\w\.-]+/[\w\.-]+/(info/refs|git-upload-pack|git-receive-pack)$ {
# 'Error' 418 is a hack to re-use the @gitlab-git-http-server block
try_files /nonexisting-file @gitlab-git-http-server;
# 'Error' 418 is a hack to re-use the @gitlab-workhorse block
try_files /nonexisting-file @gitlab-workhorse;
}
location ~ ^{{GITLAB_RELATIVE_URL_ROOT__with_trailing_slash}}[\w\.-]+/[\w\.-]+/repository/archive {
# 'Error' 418 is a hack to re-use the @gitlab-git-http-server block
error_page 418 = @gitlab-git-http-server;
# 'Error' 418 is a hack to re-use the @gitlab-workhorse block
error_page 418 = @gitlab-workhorse;
return 418;
}
location ~ ^{{GITLAB_RELATIVE_URL_ROOT__with_trailing_slash}}api/v3/projects/.*/repository/archive {
# 'Error' 418 is a hack to re-use the @gitlab-git-http-server block
error_page 418 = @gitlab-git-http-server;
# 'Error' 418 is a hack to re-use the @gitlab-workhorse block
error_page 418 = @gitlab-workhorse;
return 418;
}
location @gitlab-git-http-server {
location @gitlab-workhorse {
## If you use HTTPS make sure you disable gzip compression
## to be safe against BREACH attack.
gzip off;
@ -200,7 +200,7 @@ server {
# The following settings only work with NGINX 1.7.11 or newer
#
# # Pass chunked request bodies to gitlab-git-http-server as-is
# # Pass chunked request bodies to gitlab-workhorse as-is
# proxy_request_buffering off;
# proxy_http_version 1.1;
@ -209,7 +209,7 @@ server {
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto {{NGINX_X_FORWARDED_PROTO}};
proxy_pass http://gitlab-git-http-server;
proxy_pass http://gitlab-workhorse;
}
## Enable gzip compression as per rails guide:

View File

@ -911,11 +911,6 @@ configure_gitlab_shell() {
exec_as_git sed -i 's/{{REDIS_PORT}}/'"${REDIS_PORT}"'/' ${GITLAB_SHELL_INSTALL_DIR}/config.yml
}
configure_gitlab_git_http_server() {
echo "Configuring gitlab-git-http-server..."
sed -i 's,{{GITLAB_REPOS_DIR}},'"${GITLAB_REPOS_DIR}"',' /etc/supervisor/conf.d/gitlab-git-http-server.conf
}
configure_nginx() {
echo "Configuring nginx..."
sed -i 's/worker_processes .*/worker_processes '"${NGINX_WORKERS}"';/' /etc/nginx/nginx.conf

View File

@ -10,7 +10,6 @@ case ${1} in
initialize_system
configure_gitlab
configure_gitlab_shell
configure_gitlab_git_http_server
configure_nginx
case ${1} in