星期四, 4月 23, 2015
詹金斯要喝酒
因為 Wine 的使用者身分很難調,但在 Jenkins 上要透過它來執行 Windows 平台的程式,研究了半天,最後決定這個比較容易的辦法:將 Jenkins 執行的使用者從 jenkins 換成登入 Linux 安裝 Wine 的那個使用者,做法可以參考這篇。
在 CentOS 6 (32 bit) 安裝 Stable Wine 1.6.2
大致上可參考這篇,裝完之後可以用,不過有很多類似 "PNG support is not compiled in" 的錯誤訊息。若要解決這個問題,有兩個步驟:
- sudo yum -y install libpng-devel
- vim /tmp/wine-1.6.2/tools/wineinstall
- CONFARGS="" -> CONFARGS="--with-png"
星期三, 4月 22, 2015
VirtualBox Host 之下的多個 Guest 網路互聯
- 關閉 VirtualBox 應用程式。
- 自訂 Host 本身的網路位址,例 10.1.2.3。
- 預計多個 Guest 所共存的網路名稱叫 intnet,位址範圍在 10.1.2.10 ~ 10.1.2.20。
- 指令:vboxmanage dhcpserver add -netname intnet -ip 10.1.2.3 -netmask 255.255.255.0 -lowerip 10.1.2.10 -upperip 10.1.2.20 -enable。
- 查詢:vboxmanage list dhcpservers。
- 開啟 VirtualBox 應用程式。
- 針對需要互聯的 Guest 都增加 internal network 網路介面,名稱叫 intnet。
- 開啟各 Guest。
星期二, 4月 21, 2015
星期一, 4月 20, 2015
星期六, 4月 18, 2015
GitLab 開機後自動執行
因為 32 位元的 GitLab 沒有安裝套件,一切都得自己來。在奮鬥許久後,終於新建了一個使用者 gitlab,抓完原始碼放在家目錄下的 gitlabhq,建置安裝完成。啟動的指令如下:
- sudo /etc/rc.d/init.d/mysqld start
- sudo /etc/rc.d/init.d/redis start
- cd && cd gitlabhq && bundle exec rails s -e production
- # exec >/var/log/rc.local.log 2>&1
- /etc/rc.d/init.d/mysqld start
- /etc/rc.d/init.d/redis start
- PATH=$PATH:/usr/local/bin
- cd /home/gitlab/gitlabhq && bundle exec rails s -e production &
星期五, 4月 17, 2015
Install GitLab on CentOS 6 32bit
GitLab 只提供 64 位元的安裝套件,沒想到在 32 位元的環境這麼難裝,基本上參考一篇快滿三年的文章,再修改一些步驟以解決問題,紀錄一下:
# add current user to sudoers
# www connected
sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
sudo sed -i "s/mirrorlist=https/mirrorlist=http/" /etc/yum.repos.d/epel.repo
sudo yum -y groupinstall 'Development Tools' 'Additional Development'
sudo yum -y install readline readline-devel ncurses-devel gdbm-devel
glibc-devel tcl-devel openssl-devel curl-devel expat-devel db4-devel
byacc gitolite sqlite-devel gcc-c++ libyaml libyaml-devel libffi
libffi-devel libxml2 libxml2-devel libxslt libxslt-devel libicu
libicu-devel system-config-firewall-tui python-devel redis
curl -O http://ftp.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gz
tar xzvf ruby-2.2.2.tar.gz
cd ruby-2.2.2
./configure --enable-shared --disable-pthread
sudo make && sudo make install
sudo yum -y install qt-devel qtwebkit-devel
export PATH=$PATH:/usr/lib/qt4/bin
alias sudo="sudo env PATH=$PATH"
sudo gem update --system
sudo gem update
sudo gem install rails
sudo adduser --shell /bin/bash --create-home --home-dir /home/gitlab gitlab
sudo passwd gitlab
su gitlab
ssh-keygen -t rsa
# keep default filename, empty for no passphrase
exit
sudo adduser --system --shell /bin/sh --comment 'gitolite'
--create-home --home-dir /home/git git
sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub
sudo passwd git
su git
gl-setup ~/gitlab.pub
# When the prompt appears edit the provided file (it's in a vi-Editor)
and set $REPO_UMASK to 0007
exit
sudo usermod -a -G git gitlab
sudo chmod -R g+rwX /home/git/repositories/
sudo chmod 770 /home/git
sudo service sshd start
su gitlab
ssh git@localhost
exit
exit
su -
curl https://bootstrap.pypa.io/ez_setup.py | python
exit
sudo easy_install pip
sudo pip install pygments
sudo gem install bundler
sudo visudo
# add: gitlab ALL=(ALL) ALL
sudo gem install charlock_holmes
sudo yum -y install cmake
sudo gem install rugged -v '0.21.4'
su gitlab
cd && git clone https://github.com/gitlabhq/gitlabhq.git
cd gitlabhq
bundle install
sudo yum -y install mysql-server
sudo yum -y install nodejs
sudo /etc/init.d/mysqld start
mysql_secure_installation
mysql -u root -p
mysql> CREATE DATABASE gitlab CHARACTER SET UTF8;
mysql> GRANT ALL PRIVILEGES ON gitlab.* TO 'gitlabusr'@'localhost'
IDENTIFIED BY 'supersecret' WITH GRANT OPTION;
mysql> quit
sudo nohup redis-server > /dev/null
# hit CTRL+Z
bg
cp ~/gitlabhq/config/database.yml.mysql ~/gitlabhq/config/database.yml
cp ~/gitlabhq/config/gitlab.yml.example ~/gitlabhq/config/gitlab.yml
vim ~/gitlabhq/config/database.yml
# In database.yml you have to edit the production settings of your
database (at the very top of the file). You have to change the
database-name, username and password.
RAILS_ENV=production rake db:setup
RAILS_ENV=production rake db:seed_fu
bundle exec rails s -e production
# visit http://localhost:3000 with root / 5iveL!fe
以上。日後要啟動 GitLab 服務的步驟也整理在此:
# Terminal #1
sudo /etc/rc.d/init.d/mysqld start
redis-server
# Terminal #2
su gitlab
cd
cd gitlabhq
bundle exec rails s -e production
# add current user to sudoers
# www connected
sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
sudo sed -i "s/mirrorlist=https/mirrorlist=http/" /etc/yum.repos.d/epel.repo
sudo yum -y groupinstall 'Development Tools' 'Additional Development'
sudo yum -y install readline readline-devel ncurses-devel gdbm-devel
glibc-devel tcl-devel openssl-devel curl-devel expat-devel db4-devel
byacc gitolite sqlite-devel gcc-c++ libyaml libyaml-devel libffi
libffi-devel libxml2 libxml2-devel libxslt libxslt-devel libicu
libicu-devel system-config-firewall-tui python-devel redis
curl -O http://ftp.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gz
tar xzvf ruby-2.2.2.tar.gz
cd ruby-2.2.2
./configure --enable-shared --disable-pthread
sudo make && sudo make install
sudo yum -y install qt-devel qtwebkit-devel
export PATH=$PATH:/usr/lib/qt4/bin
alias sudo="sudo env PATH=$PATH"
sudo gem update --system
sudo gem update
sudo gem install rails
sudo adduser --shell /bin/bash --create-home --home-dir /home/gitlab gitlab
sudo passwd gitlab
su gitlab
ssh-keygen -t rsa
# keep default filename, empty for no passphrase
exit
sudo adduser --system --shell /bin/sh --comment 'gitolite'
--create-home --home-dir /home/git git
sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub
sudo passwd git
su git
gl-setup ~/gitlab.pub
# When the prompt appears edit the provided file (it's in a vi-Editor)
and set $REPO_UMASK to 0007
exit
sudo usermod -a -G git gitlab
sudo chmod -R g+rwX /home/git/repositories/
sudo chmod 770 /home/git
sudo service sshd start
su gitlab
ssh git@localhost
exit
exit
su -
curl https://bootstrap.pypa.io/ez_setup.py | python
exit
sudo easy_install pip
sudo pip install pygments
sudo gem install bundler
sudo visudo
# add: gitlab ALL=(ALL) ALL
sudo gem install charlock_holmes
sudo yum -y install cmake
sudo gem install rugged -v '0.21.4'
su gitlab
cd && git clone https://github.com/gitlabhq/gitlabhq.git
cd gitlabhq
bundle install
sudo yum -y install mysql-server
sudo yum -y install nodejs
sudo /etc/init.d/mysqld start
mysql_secure_installation
mysql -u root -p
mysql> CREATE DATABASE gitlab CHARACTER SET UTF8;
mysql> GRANT ALL PRIVILEGES ON gitlab.* TO 'gitlabusr'@'localhost'
IDENTIFIED BY 'supersecret' WITH GRANT OPTION;
mysql> quit
sudo nohup redis-server > /dev/null
# hit CTRL+Z
bg
cp ~/gitlabhq/config/database.yml.mysql ~/gitlabhq/config/database.yml
cp ~/gitlabhq/config/gitlab.yml.example ~/gitlabhq/config/gitlab.yml
vim ~/gitlabhq/config/database.yml
# In database.yml you have to edit the production settings of your
database (at the very top of the file). You have to change the
database-name, username and password.
RAILS_ENV=production rake db:setup
RAILS_ENV=production rake db:seed_fu
bundle exec rails s -e production
# visit http://localhost:3000 with root / 5iveL!fe
以上。日後要啟動 GitLab 服務的步驟也整理在此:
# Terminal #1
sudo /etc/rc.d/init.d/mysqld start
redis-server
# Terminal #2
su gitlab
cd
cd gitlabhq
bundle exec rails s -e production
星期四, 4月 16, 2015
VirtualBox Guest Additions on CentOS 6
看了很多篇文章,最正確完整的是這篇。唯一的一個小問題,如果在裝完 epel 6 rpm 之後的 yum install 出現 Cannot retrieve metalink 的錯誤,要多跑這個指令:
[2015/06/29] 若是由 osboxes.org 抓的 CentOS 7 image,步驟可以少很多,符合這篇文章 4.2.2.1.6 小節的描述,基本上只要:
- sudo sed -i "s/mirrorlist=https/mirrorlist=http/" /etc/yum.repos.d/epel.repo
[2015/06/29] 若是由 osboxes.org 抓的 CentOS 7 image,步驟可以少很多,符合這篇文章 4.2.2.1.6 小節的描述,基本上只要:
- sudo yum update -y
- sudo yum install -y gcc kernel-devel
- reboot
- install Guest Additions
- reboot
星期一, 4月 13, 2015
CentOS 6.3 + Jenkins + Git
由於 CentOS 6.3 內建的 Git 較舊,在最近的 Jenkins 版本使用了新功能(git config --local)會導致錯誤,必須先升級。
訂閱:
文章 (Atom)