From b6d27b54cac1995000518184de7e969b8424bde8 Mon Sep 17 00:00:00 2001 From: Erwin Junge Date: Tue, 30 Mar 2021 20:24:20 +0200 Subject: [PATCH] Add support for enterprise edition --- Dockerfile | 1 + README.md | 10 +++++++++- assets/build/install.sh | 17 +++++++++++++---- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 547861a8b..1957ca30f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -58,6 +58,7 @@ RUN set -ex && \ && rm -rf /var/lib/apt/lists/* COPY assets/build/ ${GITLAB_BUILD_DIR}/ +ARG GITLAB_EDITION=ce RUN bash ${GITLAB_BUILD_DIR}/install.sh COPY assets/runtime/ ${GITLAB_RUNTIME_DIR}/ diff --git a/README.md b/README.md index a95ff93ba..c05f355ce 100644 --- a/README.md +++ b/README.md @@ -134,12 +134,20 @@ You can also pull the `latest` tag which is built from the repository *HEAD* docker pull sameersbn/gitlab:latest ``` -Alternatively you can build the image locally. +Alternatively you can build the images locally. + +## Community Edition ```bash docker build -t sameersbn/gitlab github.com/sameersbn/docker-gitlab ``` +## Enterprise Edition + +```bash +docker build --build-arg GITLAB_EDITION=ee -t sameersbn/gitlab-ee github.com/sameersbn/docker-gitlab +``` + # Quick Start The quickest way to get started is using [docker-compose](https://docs.docker.com/compose/). diff --git a/assets/build/install.sh b/assets/build/install.sh index 32cfd21fe..1f5338bbf 100755 --- a/assets/build/install.sh +++ b/assets/build/install.sh @@ -1,7 +1,16 @@ #!/bin/bash set -e -GITLAB_CLONE_URL=https://gitlab.com/gitlab-org/gitlab-foss.git +GITLAB_EDITION=${GITLAB_EDITION:-ce} + +# if we're using the enterprise edition suffix the version with -ee +if [ x"${GITLAB_EDITION}" = x"ee" ] ; then + GITLAB_VERSION="${GITLAB_VERSION}-ee" + GITLAB_CLONE_URL=https://gitlab.com/gitlab-org/gitlab.git +else + GITLAB_CLONE_URL=https://gitlab.com/gitlab-org/gitlab-foss.git +fi + GITLAB_SHELL_URL=https://gitlab.com/gitlab-org/gitlab-shell/-/archive/v${GITLAB_SHELL_VERSION}/gitlab-shell-v${GITLAB_SHELL_VERSION}.tar.bz2 GITLAB_PAGES_URL=https://gitlab.com/gitlab-org/gitlab-pages.git GITLAB_GITALY_URL=https://gitlab.com/gitlab-org/gitaly.git @@ -63,12 +72,12 @@ exec_as_git git config --global gc.auto 0 exec_as_git git config --global repack.writeBitmaps true exec_as_git git config --global receive.advertisePushOptions true -# shallow clone gitlab-foss -echo "Cloning gitlab-foss v.${GITLAB_VERSION}..." +# shallow clone gitlab +echo "Cloning gitlab-${GITLAB_EDITION} v.${GITLAB_VERSION}..." exec_as_git git clone -q -b v${GITLAB_VERSION} --depth 1 ${GITLAB_CLONE_URL} ${GITLAB_INSTALL_DIR} if [[ -d "${GITLAB_BUILD_DIR}/patches" ]]; then -echo "Applying patches for gitlab-foss..." +echo "Applying patches for gitlab-${GITLAB_EDITION}..." exec_as_git git -C ${GITLAB_INSTALL_DIR} apply --ignore-whitespace < ${GITLAB_BUILD_DIR}/patches/*.patch fi