跳转到内容

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.ruby-lang.org.cn/.

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.ruby-lang.org.cn/
  # 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 <[email protected]>, Michal Papis <[email protected]> [https://rvm.ruby-lang.org.cn/]

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 界面或存储库维基等功能。

华夏公益教科书