くまきち

山と旅と家族が大事。
でも激しい物欲が理性と財布のタガを飛ばす
最近は自転車も乗ってる

OpenShift on FreeBSD 8R

2012-03-05 18:31:51 | SEまわり
CentOS 上でやってみても、なかなか思うように進められなかったので、FreeBSD で OpenShift を使う(?)環境を整えてみた。

Ruby, rubugems, git は ports 一発インストールで完了。手順は 本家のQuickStart を見ながら。

 
gem install rhc


これも一発完了

続いて、

 
% rhc-create-domain -n bear -l rhlogin
(rhlogin は あらかじめ regist しておいたものを使用)
Password:
Generating OpenShift Express ssh key to /home/ooki/.ssh/libra_id_rsa
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ooki/.ssh/libra_id_rsa.
Your public key has been saved in /home/ooki/.ssh/libra_id_rsa.pub.
The key fingerprint is:
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx ooki@example.com
The key's randomart image is:
+--[ RSA 2048]----+
| oE+o|
| . .o.|
| o +.|
| . . + +|
| S.. . + |
| ..o.. . .|
| o +o. . |
| . +o. |
| o. |
+-----------------+
Problem reported from server. Response code was 400.
Re-run with -d for more information.

RESULT:
User with login 'ooki@example.com' already has a domain with namespace 'bear'


先に Web ページにて、bear というドメインを作ってあったため、こういう警告はでてしまったが、RSA 鍵生成などは正常に終わっているので、これで良い。

次に、

 
rhc-create-app -a myapp -t php-5.3
(* myapp のところは自分の作る app 名に適当に変更)


とすると、

 
% rhc-create-app -a testapp -t php-5.3
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- iconv (LoadError)
(以下略)


となって停止。ruby の iconv が必要らしい。

 
cd /usr/ports/converters/ruby-iconv
make install clean distclean


としてから、再度、rhc-create-app してみる。

 
% rhc-create-app -a testapp -t php-5.3


ドキュメントでは、ここでパスワードを訊かれるはずなんだけど、以下のように Usage が表示されて終わってしまう。

 
Created local config file: /home/ooki/.openshift/express.conf
express.conf contains user configuration and can be transferred across clients.

RHLogin is required
Obtaining list of cartridges (please excuse the delay)...

Usage: /usr/local/bin/rhc-create-app
Create an OpenShift Express app.

-a|--app application Application name (alphanumeric - max 32 chars) (required)
-t|--type type Type of app to create (python-2.6, jenkins-1.4, ruby-1.8, raw-0.1, php-5.3, jbossas-7.0, perl-5.10) (required)
-l|--rhlogin rhlogin Red Hat login (RHN or OpenShift login with OpenShift Express access) (required)
-p|--password password RHLogin password (optional, will prompt)
-r|--repo path Git Repo path (defaults to ./$app_name)
-n|--nogit Only create remote space, don't pull it locally
-d|--debug Print Debug info
-h|--help Show Usage info
--no-dns Skip DNS check. Must be used in combination with --nogit
--config path Path of alternate config file
--timeout # Timeout, in seconds, for connection
--enable-jenkins [name] Create a Jenkins application (see Note 1)

Notes:
1. Jenkins applications will have Jenkins embedded. Their default name will be 'jenkins' if not specified and the '--no-dns' flag is ignored.


RH アカウントを指定してやりなおし

 
% rhc-create-app -a testapp -t php-5.3 -l ooki@example.com
Password:
Creating application: testapp
Now your new domain name is being propagated worldwide (this might take a minute)...
The authenticity of host 'testapp-bear.rhcloud.com (107.22.35.141)' can't be established.
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'testapp-bear.rhcloud.com,xxx.xxx.xxx.xxx' (RSA) to the list of known hosts.
Enter passphrase for key '/home/ooki/.ssh/id_dsa':
Confirming application 'testapp' is available: Success!

testapp published: http://testapp-bear.rhcloud.com/
git url: ssh://hogehogefugafuga@testapp-bear.rhcloud.com/~/git/testapp.git/
Successfully created application: testapp


うまくいった。

最後のところで、DSA鍵のパスフレーズを訊かれているのは、Web ページにて公開鍵を登録してあったため。

次に、アプリを commit してみる

 
% cd testapp
% git commit -a -m "first"
git commit -a -m "first"
# On branch master
nothing to commit (working directory clean)


何も変更してないので当たり前。

続いてデプロイ


 
% git push
git push
Enter passphrase for key '/home/ooki/.ssh/id_dsa':
Everything up-to-date


以上で終わり。

別に FreeBSD でも動くじゃん。

最新の画像もっと見る