今日は、OpenShift上で作成・公開しているアプリケーションのソースコードをgit cloneして、ローカルで開発できる環境をつくります。
OpenShiftのWEBページで、アプリケーション詳細画面を開く
Source Codeに表示されている、git cloneで使うURLを確認します。
1のURLを使って、git cloneする
(Macのターミナルから操作しています)
git cloneしたい場所で、
git clone {1のURLのコピペ}
というコマンドを実行します。
もうちょっと詳しく書くと・・・
cd ~~/openshift_apps/ git clone ssh://xxxxxxxxx@xxxxxx-xxxxx.rhcloud.com/~/git/blog.git/
下記のように、git cloneするかどうか聞かれるので、yesと打ち込みます。
Cloning into 'xxxxxx'... The authenticity of host 'xxxxx-xxxxx.rhcloud.com (XX.XX.XXX.XX)' can't be established. RSA key fingerprint is xxxx~~~~~~. Are you sure you want to continue connecting (yes/no)? yes
実行が終わると、OpenShift上に作成したアプリケーションと同じ名前のディレクトリが作成されました★
変更をOpenShiftのアプリケーションにデプロイする
普段のgit操作と変わりません!
HerokuはコマンドがHeroku用に少し異なっていたけど、OpenShiftはgitコマンドと同じものがそのまま使えるようです。
git add -A git commit -a -m "modify XXX" git push origin master
実行中にたくさんログが表示されますが、それらのログの最後に下記のような表示が出たらデプロイが成功しています٩( ‘ω’ )و
remote: ------------------------- remote: Git Post-Receive Result: success remote: Activation status: success remote: Deployment completed with status: success To ssh://xxxxxxxx@xxxx-xxxx.rhcloud.com/~/git/xxx.git/ xxxxx..xxxxx master -> master