Commit 871a3b9e authored by Carlo Landmeter's avatar Carlo Landmeter
Browse files

get source based on sha

parent 6bcf546f
......@@ -12,8 +12,13 @@ get_source() {
local project=$1
local version=$2
local destination=$3
git -c advice.detachedHead=false clone --branch "v$version" --depth=1 \
https://gitlab.com/gitlab-org/$project.git "$destination"
# version can be a tag or sha
[ "${#version}" != 40 ] && version="v$version"
mkdir -p "$destination" && cd "$destination"
git init
git remote add origin https://gitlab.com/gitlab-org/$project.git
git fetch --depth 1 origin $version
git -c advice.detachedHead=false checkout FETCH_HEAD
}
####################################################################
......@@ -103,7 +108,7 @@ bundle install --without development test mysql aws kerberos
## gitlab-shell
###############
GITLAB_SHELL_VERSION=$(cat "$gitlab_location"/GITLAB_SHELL_VERSION)
get_source gitlab-shell $GITLAB_SHELL_VERSION "/home/git/gitlab-shell"
get_source gitlab-shell "$GITLAB_SHELL_VERSION" "/home/git/gitlab-shell"
cd /home/git/gitlab-shell
# needed for setup
ln -sf config.yml.example config.yml
......@@ -118,7 +123,7 @@ ln -s /usr/local/bin/ruby /usr/bin/ruby
## gitlab-workhorse
###################
GITLAB_WORKHORSE_VERSION=$(cat "$gitlab_location"/GITLAB_WORKHORSE_VERSION)
get_source gitlab-workhorse $GITLAB_WORKHORSE_VERSION "/home/git/src/gitlab-workhorse"
get_source gitlab-workhorse "$GITLAB_WORKHORSE_VERSION" "/home/git/src/gitlab-workhorse"
cd /home/git/src/gitlab-workhorse
make && make install
......@@ -126,7 +131,7 @@ make && make install
## gitlab-pages
###############
GITLAB_PAGES_VERSION=$(cat "$gitlab_location"/GITLAB_PAGES_VERSION)
get_source gitlab-pages $GITLAB_PAGES_VERSION "/home/git/src/gitlab-pages"
get_source gitlab-pages "$GITLAB_PAGES_VERSION" "/home/git/src/gitlab-pages"
cd /home/git/src/gitlab-pages
make
install ./gitlab-pages /usr/local/bin/gitlab-pages
......@@ -136,8 +141,7 @@ install ./gitlab-pages /usr/local/bin/gitlab-pages
## will also install ruby gems into system like gitlab
#########
GITALY_SERVER_VERSION=$(cat "$gitlab_location"/GITALY_SERVER_VERSION)
git clone https://gitlab.com/gitlab-org/gitaly.git -b \
v$GITALY_SERVER_VERSION /home/git/src/gitaly
get_source gitaly "$GITALY_SERVER_VERSION" "/home/git/src/gitaly"
cd /home/git/src/gitaly
patch -p0 -i /tmp/gitaly/gitaly-set-defaults.patch
make install BUNDLE_FLAGS=--system
......
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