| Line 1: |
Line 1: |
| − | =Install= | + | =Install Omnibus Package= |
| − | see: https://about.gitlab.com/downloads<br /> | + | www.gitlab.com |
| | + | ==Disable bundled Nginx== |
| | + | @/etc/gitlab/gitlab.rb |
| | + | ==Setup Nginx== |
| | + | see snippet @https://git.herrerosolis.com |
| | | | |
| − | *Install curl, openssh-server, ca-certificates postfix
| + | =Install From Source (Not recomended)= |
| − | sudo apt-get install curl openssh-server ca-certificates postfix | + | see: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md<br /> |
| − | *Add the GitLab package server and install the package
| + | ssl: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/misc/ssl-certificate-implemented |
| − | curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash | + | ===Upgrade gitlab-shell=== |
| − | sudo apt-get install gitlab-ce | + | <source lang="bash"> |
| − | Or select and download
| + | cd /home/git/gitlab-shell |
| − | curl -LJO https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/trusty/gitlab-ce-XXX.deb/download | + | sudo -u git -H git fetch |
| − | dpkg -i gitlab-ce-XXX.deb
| + | sudo -u git -H git checkout v1.9.6 |
| − | ==Configuration==
| + | </source> |
| − | /etc/gitlab/gitlab.rb | + | ===Resync authorized_keys file=== |
| − | sudo gitlab-ctl reconfigure
| + | sudo -u git -H bundle exec rake gitlab:shell:setup RAILS_ENV=production |
| − | *Browse to the hostname and login:
| + | ===Database=== |
| − | Username: root
| + | Recomended PostgreSQL<br /> |
| − | Password: 5iveL!fe
| + | <source lang="bash"> |
| − | * For configuration and troubleshooting options please see the Omnibus GitLab documentation<br />
| + | # Install the database packages |
| − | http://doc.gitlab.com/omnibus/
| + | sudo apt-get install -y postgresql postgresql-client libpq-dev |
| | + | |
| | + | # Login to PostgreSQL |
| | + | sudo -u postgres psql -d template1 |
| | + | |
| | + | # Create a user for GitLab |
| | + | # Do not type the 'template1=#', this is part of the prompt |
| | + | template1=# CREATE USER git CREATEDB; |
| | + | |
| | + | # Create the GitLab production database & grant all privileges on database |
| | + | template1=# CREATE DATABASE gitlabhq_production OWNER git; |
| | + | |
| | + | # Quit the database session |
| | + | template1=# \q |
| | + | |
| | + | # Try connecting to the new database with the new user |
| | + | sudo -u git -H psql -d gitlabhq_production |
| | + | |
| | + | # Quit the database session |
| | + | gitlabhq_production> \q |
| | + | </source> |
| | + | ==Default repositorys== |
| | + | git_data_dir "/var/opt/gitlab/git-data" |
| | + | <br /> |
| | + | |
| | + | = Registry = |
| | + | Add to /etc/gitlab/gitlab.rb the following line<syntaxhighlight lang="ruby"> |
| | + | registry_external_url 'https://git.rra.lan:4443' |
| | + | </syntaxhighlight>Run <syntaxhighlight lang="bash"> |
| | + | gitlab-ctl reconfigure |
| | + | </syntaxhighlight><br /> |
| | + | |
| | + | = Let's Encrypt = |
| | + | Add to /etc/gitlab/gitlab.rb the following lines<syntaxhighlight lang="ruby"> |
| | + | letsencrypt['enable'] = true |
| | + | letsencrypt['contact_emails'] = ['redteam@bbva.com'] |
| | + | letsencrypt['auto_renew_hour'] = "12" |
| | + | letsencrypt['auto_renew_minute'] = "30" |
| | + | letsencrypt['auto_renew_day_of_month'] = "*/7" |
| | + | letsencrypt['auto_renew'] = false |
| | + | |
| | + | </syntaxhighlight>Run <syntaxhighlight lang="bash"> |
| | + | gitlab-ctl reconfigure |
| | + | </syntaxhighlight> |
| | + | |
| | + | =Update= |
| | + | [https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/patch_versions.md Guide] |
| | + | Notes:<br /> |
| | + | If it fails with: gem "pg"...<br /> |
| | + | Edit /home/git/Gemfile<br /> |
| | + | Search for: |
| | + | <nowiki> |
| | + | # Supported DBs |
| | + | gem "mysql2", '~> 0.3.16', group: :mysql |
| | + | #gem "pg", '~> 0.18.2', group: :postgres <--------COMMENT THIS LINE </nowiki> |
| | + | Search for: |
| | + | <nowiki> |
| | + | group :production do |
| | + | gem "gitlab_meta", '7.0' |
| | + | gem "pg", '~> 0.18.2', group: :postgres <--------- ADD THIS |
| | + | end </nowiki> |
| | + | |
| | + | If it fails with *pg_trgm* |
| | + | sudo apt-get install postgresql-contrib |
| | + | sudo -u postgres psql -d gitlabhq_production -c "create extension pg_trgm;" |
| | + | |
| | + | =CI Runner setup @raspberry pi= |
| | + | [https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/install/linux-repository.md GitLab Documentation] |
| | + | |
| | + | #Install Docker |
| | + | #:<pre>curl -sSL https://get.docker.com/ | sh</pre> |
| | + | #Add gitlab repository |
| | + | #:<pre>curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash</pre> |
| | + | #Debian should use apt pinning |
| | + | #:<pre>cat > /etc/apt/preferences.d/pin-gitlab-runner.pref <<EOF |
| | + | #::Explanation: Prefer GitLab provided packages over the Debian native ones |
| | + | #::Package: gitlab-ci-multi-runner |
| | + | #::Pin: origin packages.gitlab.com |
| | + | #::Pin-Priority: 1001 |
| | + | #::EOF</pre> |
| | + | #Install gitlab-ci-multi-runner |
| | + | #:<pre>sudo apt-get install gitlab-ci-multi-runner</pre> |