Skip to content

Instantly share code, notes, and snippets.

@Halleck45
Created March 19, 2014 16:36
Show Gist options
  • Save Halleck45/9645694 to your computer and use it in GitHub Desktop.
Save Halleck45/9645694 to your computer and use it in GitHub Desktop.
Jenkins, Gitlab and Capistrano on CentOS 6.5 (64 bits)
#!/bin/bash
# author: Jean-François Lépine
# Ruby
# -----------------------
curl -L get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm reload
rvm install 2.1.0
rvm use 2.1.0 --default
# Capistrano
# -----------------------
gem install capistrano
#!/bin/bash
# author: Jean-François Lépine
# Help: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
# port of Gitlab: 80
# user: root
# password 5iveL!fe
# Packages
# -----------------------
yum update
yum install -y git openssh-server postfix vim wget
# Gitlab
# -----------------------
wget https://downloads-packages.s3.amazonaws.com/gitlab-6.6.5_omnibus-1.el6.x86_64.rpm
rpm -i gitlab-6.6.5_omnibus-1.el6.x86_64.rpm
# Configuration
# -----------------------
mkdir -p /etc/gitlab
touch /etc/gitlab/gitlab.rb
chmod 600 /etc/gitlab/gitlab.rb
echo "external_url \"http://gitlab.monserver.fr\"" > /etc/gitlab/gitlab.rb
gitlab-ctl reconfigure
# Firewall
# -----------------------
lokkit -s http -s ssh
# Start
# -----------------------
gitlab-ctl start
# On startup
# -----------------------
echo "gitlab-ctl start" > /etc/init.d/gitlab
chmod +x /etc/init.d/gitlab
# Backup jobs
# -----------------------
echo "0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create" > /tmp/gitlab-backup
cat /tmp/gitlab-backup |crontab -
#!/bin/bash
# author: Jean-François Lépine
# port of Jenkins: 8081
# Jenkins
# -----------------------
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
yum update
yum -y install jenkins java-1.7.0-openjdk.x86_64
# Use port 8081 instead of 8080
sed -e s/8080/8081/ /etc/sysconfig/jenkins > /tmp/jenkins.conf && mv -f /tmp/jenkins.conf /etc/sysconfig/jenkins
# Start Jekins
/etc/init.d/jenkins start
# Public key (for deployment)
sudo -u jenkins -H ssh-kegen -b 2048 -t rsa -f /var/lib/jenkins/.ssh/id_rsa -q
#!/bin/bash
# author: Jean-François Lépine
# Enable Gitlab
# -----------------------
./provision-gitlab.sh
# Enable Jenkins
# -----------------------
./provision-jenkins.sh
# Enable Capistrano
# -----------------------
./provision-capistrano.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment