2013年8月現在無料で利用できるJAVA paas OpenShiftへの引っ越しNo3

自分が作った、プロジェクトファイルを先ほど作成した、アプリケーションを使って、
デプロイする方法

前日のページの最後に
Cloned to: C:/Users/ユーザー名/sinzyfx
と表示されていました。

これは、ソースコードがC:/Users/ユーザー名/sinzyfxにダウンロードできたよということです。

たとえば、index.html
C:\Users\ユーザー名\sinzyfx\src\main\webapp\index.html
のわかりやすい場所を変更して、デプロイし直します。

1)index.html 編集
2)コマンドラインで、 git add .
3)コマンドラインで、 git commit -a - m "comment"
4)コマンドラインで、 git push
とやります。

で、3)のcommitで以下のメッセージが表示されます。

C:\Users\ユーザー名\sinzyfx>git commit -a -m "aaa"

Please tell me who you are.

Run

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'sinzyfx@sinzyfx-HP.(none)')

C:\Users\ユーザー名\sinzyfx>

メルアドと名前を登録せよとのことですので、
やります。

コマンドラインで以下のように入力します。

git config --global user.email "あなたのメルアド"
git config --global user.name "あなたの名前"


後は、コマンドラインで以下のように入力するだけ

C:\Users\ユーザー名\sinzyfx>git commit -a - m "comment"
C:\Users\ユーザー名\sinzyfx>git push

webサイトで変更を確認してください。


さて、これからが、本番です。

自分の作成したプロジェクトファイルをデプロイします。

A)今回作成したプロジェクト C:\Users\ユーザー名\sinzyfx
B)自分で過去に作成したプロジェクト C:\Users\ユーザー名\sinchanfx1
とします。

A)のフォルダ以下のファイルを全て消します。

C:\Users\ユーザー名\sinzyfx>git rm -r *

これでもtargetフォルダが残るので、エクスプローラで消します。

コマンドラインのディレクトリを
C:\Users\ユーザー名
に戻します。
以下のコマンドで、フォルダを丸ごとコピー

C:\Users\ユーザー名>xcopy /S /E /F /G /H /R /K /Y sinchanfx1 sinzyfx

これで、rhc create-app sinzyfx で作成したアプリの内容を、
自分で作成したsinchanfx1の内容に書き換えることができました。

コマンドラインをsinzyfxに移動して、
以下のコマンドを打つ

C:\Users\ユーザー名\sinzyfx>git add .
C:\Users\ユーザー名\sinzyfx>git commit -a - m "aaa"
C:\Users\ユーザー名\sinzyfx>git push

これで、自分が過去に作成したsinchanfx1のアプリをsinzyfxの名前でデプロイできました。
URLで確認してください。


このままでは、ソースコードeclipseで編集できないので、レッドハットの開発環境(JBoss Developer Studio)を
インストールして、ソースコードをインポートします。
その後、JBoss Developer Studio でソースコードを編集して、JBoss Developer Studioからデプロイ(push)します。

では!!