跳轉到內容

ROSE 編譯器框架/系統管理

來自華夏公益教科書,開放世界的開放書籍

手動重啟流程

[編輯 | 編輯原始碼]

如果 @reboot cron 作業沒有在 [hudson-rose-30] 上正確儲存,請

  • 啟動 Jenkins
$ ssh hudson-rose@hudson-rose-30
$ cd ~/JENKINS
$ ./start.sh
  • 啟動 Redmine
$ ssh hudson-rose@hudson-rose-30
$ cd ~/opt/redmine
$ ./redmine.sh start

這兩個指令碼都應該為每個服務啟動一個 screen。

  • 檢查狀態
$ screen –ls
  • Github

請確保 Github 也在 [rose-git] 上啟動。我想你可能需要重新啟動虛擬機器。

Apache Tomcat

[編輯 | 編輯原始碼]

Apache Tomcat servlet 在 hudson-rose-30 上本地執行。

startup.sh呼叫catalina.sh start它引用了我們自定義的jenkins-env.sh.

hudson-rose-30 $ /export/tmp.hudson-rose/applications/apache/tomcat/bin/startup.sh

@reboot

[編輯 | 編輯原始碼]
  hudson-rose-30 $ crontab -e
  @reboot /export/tmp.hudson-rose/applications/apache/tomcat/bin/startup.sh
hudson-rose-30 $ /export/tmp.hudson-rose/applications/apache/tomcat/bin/shutdown.sh

本地安裝透過 Jenkins 同步到NFS/home/hudson-rose/Applications/apache/tomcat/.

RVM (Ruby 版本管理器)

[編輯 | 編輯原始碼]

Ruby 版本管理器 (RVM), https://rvm.io/.

1. 下載rvm-installer:

  # Download
  $ wget --no-check-certificate https://get.rvm.io
  ...
  Saving to: `rvm-installer'

  100%[====================================================================>] 9,439       --.-K/s   in 0s      

  2012-07-05 17:09:08 (20.5 MB/s) - `rvm-installer' saved [9439/9439]

  # Change permissions to make it executable
  $ chmod +x ./rvm-installer

2. 將 RVM 安裝到本地使用者位置(即,不要安裝到 root/sudo 位置,如/usr/bin):

首先,停用 cURL 中使用的 SSL 證書檢查,rvm-installer因為它在防火牆後面可能會出現問題。你可以手動執行此步驟(推薦),或者使用此臨時指令碼

  $ sed -i 's/curl -/curl --insecure -/g' rvm-installer

其次,設定rvm_path環境變數以指定你的安裝位置(類似於--prefix用於 Autoconf 專案)

  $ export rvm_path=$(pwd)/rvm

最後,安裝 RVM

  $ ./rvm-installer
  Downloading RVM from wayneeseguin branch master
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  100 1047k  100 1047k    0     0   322k      0  0:00:03  0:00:03 --:--:--  740k

  Installing RVM to /export/tmp.hudson-rose/opt/ruby/rvm/
      RVM PATH line found in /home/hudson-rose/.zshrc.
      RVM sourcing line found in /home/hudson-rose/.bash_profile /home/hudson-rose/.zlogin.

  # RVM:  Shell scripts enabling management of multiple ruby environments.
  # RTFM: https://rvm.io/
  # HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)
  # Cheatsheet: http://cheat.errtheblog.com/s/rvm/
  # Screencast: http://screencasts.org/episodes/how-to-use-rvm

  # In case of any issues read output of 'rvm requirements' and/or 'rvm notes'

  Installation of RVM in /export/tmp.hudson-rose/opt/ruby/rvm/ is almost complete:

    * To start using RVM you need to run `source /export/tmp.hudson-rose/opt/ruby/rvm/scripts/rvm`
      in all your open shell windows, in rare cases you need to reopen all shell windows.

  # hudson-rose,
  #
  #   Thank you for using RVM!
  #   I sincerely hope that RVM helps to make your life easier and more enjoyable!!!
  #
  # ~Wayne


  rvm 1.14.5 () by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

3. 使用 RVM:現在,我們可以使用 RVM(如上述 RVM 安裝訊息中所述)

  $ source /export/tmp.hudson-rose/opt/ruby/rvm/scripts/rvm

例如,

  [hudson-rose@hudson-rose-31]which rvm
  /export/tmp.hudson-rose/opt/ruby/rvm/bin/rvm

安裝 Ruby:

# Nothing is installed yet...
[hudson-rose@hudson-rose-31]rvm list

rvm rubies

# No rvm rubies installed yet. Try 'rvm help install'.
# Check what's available...
[hudson-rose@hudson-rose-31]rvm list known | grep "\[ruby-"
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-p370]
[ruby-]1.9.1[-p431]
[ruby-]1.9.2-p180
[ruby-]1.9.2-p290
[ruby-]1.9.2-p318
[ruby-]1.9.2[-p320]
[ruby-]1.9.2-head
[ruby-]1.9.3-preview1
[ruby-]1.9.3-rc1
[ruby-]1.9.3-p0
[ruby-]1.9.3-p125
[ruby-]1.9.3[-p194]
[ruby-]1.9.3-head
# Install Ruby version 1.9.2-p320
[hudson-rose@hudson-rose-31]rvm install ruby-1.9.2-p320
...
ruby-1.9.2-p320 - adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.2-p320 - #importing default gemsets (/export/tmp.hudson-rose/opt/ruby/rvm/gemsets/)
Install of ruby-1.9.2-p320 - #complete
[hudson-rose@hudson-rose-31]rvm list

rvm rubies

=* ruby-1.9.2-p320 [ x86_64 ]

# => - current
# =* - current && default
#  * - default
GCC 4.2.4
=========
  $ source /nfs/apps/gcc/4.2.4/setup.sh
  $ source /nfs/apps/gmp/4.2.4/setup.sh 
  $ source /nfs/apps/mpfr/2.3.2/setup.sh

Python 2.6.5
============
  $ source /nfs/apps/python/latest/setup.sh
  $ python --version
  Python 2.6.5

  $ ./bootstrap.sh --prefix=/export/tmp.hudson-rose/opt/boost_64bit_install/boost_X_XX_X-inst
  $ ./b2 install --prefix=/export/tmp.hudson-rose/opt/boost_64bit_install/boost_X_XX_X-inst -j24

Sitaramc 的 Gitolite 軟體 (https://github.com/sitaramc/gitolite/) "允許你在中央伺服器上設定 Git 託管,並具有細粒度的訪問控制和許多更強大的功能。" 請參閱 文件 獲取更多詳細資訊。

以下是與檔案系統託管的儲存庫相比,Gitolite 託管的 Git 儲存庫的一些優勢

  • 僅授權訪問:用於身份驗證目的的 SSH 金鑰對
  • 僅允許 Git 操作:不允許任何人修改伺服器上的 Git 儲存庫(例如更改許可權、手動操作裸儲存庫的索引等)。這是透過使用命令關鍵字在${HOME}/.ssh/authorized_keys檔案中實現的,該檔案位於 Gitolite 伺服器上的 Gitolite 使用者帳戶中。請參閱 這篇簡短的指南 獲取更多詳細資訊。

注意:Gitolite 純粹是一個託管 Git 儲存庫的軟體工具。它不提供程式碼審查、問題跟蹤、Web 介面或儲存庫維基等功能。

華夏公益教科書