Skip to content

Instantly share code, notes, and snippets.

@LeeiFrankJaw
Last active October 16, 2018 09:10
Show Gist options
  • Save LeeiFrankJaw/c5f29f2c642765e97fa1af4d61e843a3 to your computer and use it in GitHub Desktop.
Save LeeiFrankJaw/c5f29f2c642765e97fa1af4d61e843a3 to your computer and use it in GitHub Desktop.
Set up Gitlab Development Kit on Trisquel 8

Set up Gitlab Development Kit on Trisquel 8

  • Login as non-root user.

  • Install ruby with required version (2.4.4 at the time I wrote this), the gitlab site recommends using a ruby version manager (such as RVM, rbenv, chruby).

  • Source the required script after installing ruby version manager. (In case of RVM, it may be ~/.rvm/scripts/rvm or /etc/profile.d/rvm.sh depending on how you install RVM.)

  • Install bundler by gem install bundler (though I think this step is unnecessary since it will be installed automatically later).

  • Install git version 2.18 or higher.

  • Install an up-to-date node 8.x (LTS) and yarn 1.2 or newer. (Node 8.9 doesn't work since one of the dependencies requires 8.10 or higher)

  • Install Go 1.9.6 or newer.

  • Install Google Chrome 60 or newer with ChromeDriver version 2.33 or newer. Since Google Chrome is not free/libre, I suppose it can be supplanted by Chromium.

  • Install PostgreSQL 9.x (10.x is not yet supported).

  • Install GraphicsMagick.

  • Increase the watch limit of inotify for webpack and karma to track file changes effectively. (I increased it from 8K to 512K.)

  • Install libpq-dev, redis-server, libicu-dev, cmake, g++, libre2-dev, libkrb5-dev, ed, and pkg-config if not already installed.

  • Install gitlab-development-kit by executing the following commands.

    gem install gitlab-development-kit
    gdk init [DIRECTORY]
    

    This will clone the GDK repository into ./gitlab-development-kit if the optional directory name is not given.

    You now have two choices: develop in either a fork or the main repo. I followed the fork approach.

    gdk install gitlab_repo=https://gitlab.com/YOUR-FORK/gitlab-ce.git
    support/set-gitlab-upstream
    

    Then start up the GDK as follows.

    gdk run
    

I created the script install.sh which contains I did manually setting up the GDK. I have not tested it but it should work.

#!/bin/sh
gem install gitlab-development-kit
gdk init
cd gitlab-development-kit/
# fork approach
gdk install gitlab_repo=https://gitlab.com/LeeiFrankJaw/gitlab-ce.git
support/set-gitlab-upstream
# # direct approach
# gdk install
#!/bin/sh
apt install git
git clone https://github.com/git/git.git
cd git/
git checkout v2.19.0
apt install libcurl4-openssl-dev
make configure
./configure --prefix=/usr/local --without-tcltk
sed -i 's/^\(NO_GETTEXT=\)$/\1YesPlease/' config.status
./config.status
make all
make install
# apt install --no-install-recommends asciidoc xmlto
# make man
# make install-man
#!/bin/sh
curl -O https://dl.google.com/go/go1.11.1.linux-amd64.tar.gz
tar xvf go1.11.1.linux-amd64.tar.gz -C /usr/local
echo export PATH=\$PATH:/usr/local/go/bin >> ~/.profile
export PATH=$PATH:/usr/local/go/bin
#!/bin/sh
curl -O https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz
tar xvf node-v8.12.0-linux-x64.tar.xz -C /usr/local --strip-component=1
rm -f /usr/local/{CHANGELOG.md,LICENSE,README.md}
#!/bin/sh
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
apt install curl
curl -sSL https://get.rvm.io | bash -s stable
# . /etc/profile.d/rvm.sh
. ~/.rvm/scripts/rvm
rvm install 2.4.4
# rvm docs generate-ri
rvm use --default 2.4.4
gem install bundler
#!/bin/sh
apt install apt-transport-https
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
apt update
apt install --no-install-recommends yarn
#!/bin/sh
. ./install-rvm.sh
./install-git.sh
./install-node.sh
./install-yarn.sh
. ./install-go.sh
apt install postgresql-9.5
apt install graphicsmagick
cat >> /etc/sysctl.conf <<EOF
# Increase inotify limit from 8K to 512K
fs.inotify.max_user_watches = 524288
EOF
sysctl -p
apt install libpq-dev redis-server libicu-dev cmake libre2-dev libkrb5-dev ed
./install-gdk.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment