Skip to content
Snippets Groups Projects
Commit 96968f9dbe95 authored by Georges Racinet's avatar Georges Racinet
Browse files

heptapod_docker: install heptapod code from Docker img

Up to now, the substitution of gitlab-rails by our heptapod
clone has been made at first container startup, from assets/wrapper

Doing it from the Docker image makes sure the version stays the
same between containers using the same image, and makes for a
faster start after image update.
parent 43b92af62984
No related branches found
No related tags found
No related merge requests found
......@@ -10,9 +10,9 @@
apt-get remove -y build-essential && \
apt-get clean
# Fix PATH so gitlab founds hg binary
# Fix PATH so gitlab and docker builds find hg binary
ENV PATH /usr/local/bin:$PATH
# Pre-clone our gitlab clone to avoid recloning it every time
RUN hg clone https://mirror.octobus.net/heptapod/heptapod /opt/gitlab/embedded/service/heptapod/
......@@ -14,8 +14,11 @@
ENV PATH /usr/local/bin:$PATH
# Pre-clone our gitlab clone to avoid recloning it every time
RUN hg clone https://mirror.octobus.net/heptapod/heptapod /opt/gitlab/embedded/service/heptapod/
ADD assets/setup_heptapod_rails /root
RUN chmod +x /root/setup_heptapod_rails && /root/setup_heptapod_rails
RUN pip install hg+https://mirror.octobus.net/heptapod/hg-git-heptapod/@heptapod
# Install hgserver
......@@ -37,3 +40,4 @@
# Add our own assets
ADD assets/sync_hook.py /assets/
ADD assets/global_hgrc /assets/
#!/bin/sh
set -e
cd /opt/gitlab/embedded/service/gitlab-rails
rm -Rf /opt/gitlab/embedded/service/gitlab-rails/tmp
rm -Rf /opt/gitlab/embedded/service/gitlab-rails/log
# Merge the prebaked gitlab-rails with our hg repo
# In the experimental phase, it'll be easier for development
cd /opt/gitlab/embedded/service/gitlab-rails
hg init
hg pull --config phases.publish=false ../heptapod/
hg --config extensions.topic= up heptapod -C
# gitlab-reconfigure will want to be the one to create these directories
rm -Rf /opt/gitlab/embedded/service/gitlab-rails/tmp
rm -Rf /opt/gitlab/embedded/service/gitlab-rails/log
......@@ -105,27 +105,6 @@
su -c "ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts" git
su -c "ssh-keyscan -H localhost >> ~/.ssh/known_hosts" git
# Clone heptapod in place of gitlab
if [ ! -d "/opt/gitlab/embedded/service/gitlab-rails/.hg" ]; then
# Reconfigure
rm -Rf /opt/gitlab/embedded/service/gitlab-rails/tmp
rm -Rf /opt/gitlab/embedded/service/gitlab-rails/log
# Apply our patches
hg pull -R /opt/gitlab/embedded/service/heptapod/
cd /opt/gitlab/embedded/service/gitlab-rails
hg init
time hg pull --config phases.publish=false ../heptapod/
hg --config extensions.topic= up heptapod -C
# Reconfigure
rm -Rf /opt/gitlab/embedded/service/gitlab-rails/tmp
rm -Rf /opt/gitlab/embedded/service/gitlab-rails/log
gitlab-ctl reconfigure
fi
# Manually create a ssh key for git user and install it in gitlab-shell
if [ ! -e "/var/opt/gitlab/.ssh/id_rsa" ]; then
su -c "yes | ssh-keygen -f /var/opt/gitlab/.ssh/id_rsa -N ''" git
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment