Skip to content

Commit

Permalink
Add support for enterprise edition
Browse files Browse the repository at this point in the history
  • Loading branch information
ErwinJunge committed Jun 7, 2021
1 parent 59a8d0a commit aadc52e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}/
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
Expand Down
17 changes: 13 additions & 4 deletions assets/build/install.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit aadc52e

Please sign in to comment.