Skip to content

Instantly share code, notes, and snippets.

@wnoguchi
Created June 23, 2017 10:46
Show Gist options
  • Save wnoguchi/2b5e7be0c172a2739b2a19b2a3ccacf2 to your computer and use it in GitHub Desktop.
Save wnoguchi/2b5e7be0c172a2739b2a19b2a3ccacf2 to your computer and use it in GitHub Desktop.
GitLab 9.3 Omnibus on Ubuntu Server Installation Memo

GitLab 9.3 Omnibus on Ubuntu Server Installation

  1. GitLab 9.3 Released with Code Quality and Multi-Project Pipeline Graphs | GitLab
  2. Installation methods for GitLab | GitLab

Since an installation from source is a lot of work and error prone we strongly recommend the fast and reliable Omnibus package installation (deb/rpm).

  1. tmux logging

mkdir -p ~/.tmux/log/
 vi ~/.tmux.conf

以下を追加

# ===== logging =====
#
# C-b C-p Start logging.
bind-key C-p pipe-pane -o '/bin/sh -c "while read -r LINE; do echo \"[\$(date +\"%%Y_%%m%%d_%%H%%M%%S_%%N\")] \${LINE}\" >> \${HOME}/.tmux/log/\$(date +%Y%m%d-%H%M%S)-#S-#I.#P.log; done "' \; display-message "Logging start."
# C-b C-o Stop logging
bind-key C-o pipe-pane \; display-message "Logging end."
# C-b v Open new window. Logging always. (-n is set window name.)
bind-key v new-window -n 'logging...' \; pipe-pane -o '/bin/sh -c "while read -r LINE; do echo \"[\$(date +\"%%Y_%%m%%d_%%H%%M%%S_%%N\")] \${LINE}\" >> \${HOME}/.tmux/log/\$(date +%Y%m%d-%H%M%S)-#S-#I.#P.log; done "'

tmuxを使いながらログを取る - Qiita tmuxでログを自動取得 - Qiita 続・ラフなラボ – tmux 内で SSH した時のロギングを自動でやる

# .bashrc, .zshrc等に下記を追加
if [[ $TERM = screen ]] || [[ $TERM = screen-256color ]] ; then
  LOGDIR=$HOME/Documents/term_logs
  LOGFILE=$(hostname)_$(date +%Y-%m-%d_%H%M%S_%N.log)
  [ ! -d $LOGDIR ] && mkdir -p $LOGDIR
  tmux  set-option default-terminal "screen" \; \
    pipe-pane        "cat >> $LOGDIR/$LOGFILE" \; \
    display-message  "Started logging to $LOGDIR/$LOGFILE"
fi
  1. Install and configure the necessary dependencies

sudo apt-get install curl openssh-server ca-certificates postfix
  1. Add the GitLab package server and install the package

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo apt-get install gitlab-ce
wnoguchi@gitlab:~$ curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
[sudo] password for wnoguchi:
Detected operating system as Ubuntu/xenial.
Checking for curl...
Detected curl...
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/gitlab_gitlab-ce.list...done.
Importing packagecloud gpg key... done.
Running apt-get update... done.

The repository is setup! You can now install packages.
wnoguchi@gitlab:~$ sudo apt-get install gitlab-ce
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  gitlab-ce
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 355 MB of archives.
After this operation, 1,079 MB of additional disk space will be used.
Get:1 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu xenial/main amd64 gitlab-ce amd64 9.3.0-ce.0 [355 MB]
Fetched 355 MB in 19s (18.0 MB/s)
Selecting previously unselected package gitlab-ce.
(Reading database ... 59908 files and directories currently installed.)
Preparing to unpack .../gitlab-ce_9.3.0-ce.0_amd64.deb ...
Unpacking gitlab-ce (9.3.0-ce.0) ...
Setting up gitlab-ce (9.3.0-ce.0) ...


       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.

     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/


gitlab: Thank you for installing GitLab!
gitlab: To configure and start GitLab, RUN THE FOLLOWING COMMAND:

sudo gitlab-ctl reconfigure

gitlab: GitLab should be reachable at http://gitlab.pg1x.intra
gitlab: Otherwise configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
gitlab: And running reconfigure again.
gitlab:
gitlab: For a comprehensive list of configuration options please see the Omnibus GitLab readme
gitlab: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
gitlab:
It looks like GitLab has not been configured yet; skipping the upgrade script.
  1. Configure and start GitLab

sudo gitlab-ctl reconfigure
  1. Browse to the hostname and login

http://gitlab.pg1x.intra/

On your first visit, you'll be redirected to a password reset screen to provide the password for the initial administrator account. Enter your desired password and you'll be redirected back to the login screen.

The default account's username is root. Provide the password you created earlier and login. After login you can change the username if you wish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment