2012年6月11日月曜日

OpenShiftのREADME

とりあえず機械翻訳。
徐々に直そかな。

Repo layout
リポジトリレイアウト
===========
deployments/ - location for built wars (Details below)
ビルドしたwarファイル(下の詳細)の配置場所
src/ - Maven src structure
Mavenソース構造
pom.xml - Maven build file
Mavenビルドファイル
.openshift/ - location for openshift specific files
openshiftに特有のファイルの場所
.openshift/config/ - location for configuration files such as standalone.xml (used to modify jboss config such as datasources)
standalone.xmlのような構成ファイルの場所(datasourcesのようなjboss構成を修正するのに用いられる)
../data - For persistent data (also in env var OPENSHIFT_DATA_DIR)
持続的なデータのために(環境変数OPENSHIFT_DATA_DIR)
.openshift/action_hooks/pre_build - Script that gets run every git push before the build (on the CI system if available)
あらゆるgit pushでビルドの前に走らせるスクリプト(CIシステムが有効な場合)
.openshift/action_hooks/build - Script that gets run every git push as part of the build process (on the CI system if available)
あらゆるgit pushでビルドプロセスの一部として走らせるスクリプト(CIシステムが有効な場合)
.openshift/action_hooks/deploy - Script that gets run every git push after build but before the app is restarted
あらゆるgit pushでビルド後から、アプリ再開の前に実行されるスクリプト
.openshift/action_hooks/post_deploy - Script that gets run every git push after the app is restarted
あらゆるgit pushでアプリが再開されたあと、実行されるスクリプト

Details about layout and deployment options
レイアウトと配備オプションについての詳細
==================
There are two options for deploying content to the JBoss Application Server within OpenShift:
OpenShiftの中でJBossアプリケーション・サーバに内容を展開するために、2つのオプションがあります:

1) (Preferred) You can upload your content in a Maven src structure as is this sample project and on git push have the application built and deployed.
(推奨) あなたは、このサンプル・プロジェクトであるMaven src構造で内容をアップロードすることができ、git pushでアプリケーションを構築し、配備することができます。
For this to work you'll need your pom.xml at the root of your repository and a maven-war-plugin like in this sample to move the output from the build to the deployments directory.
これを実行するため、ビルドから配備ディレクトリまで出力させるために、あなたはリポジトリのルートとこのサンプルでのようなmaven-war-pluginでpom.xmlを必要とします。
By default the warName is ROOT within pom.xml.
デフォルトで、warの名称はpom.xmlの中のROOTです。
This will cause the webapp contents to be rendered at http://app_name-namespace.rhcloud.com/.
これで、webappの内容がhttp://app_name-namespace.rhcloud.com/で表示されることになります。
If you change the warName in pom.xml to app_name, your base url would then become http://app_name-namespace.rhcloud.com/app_name.
あなたがpom.xmlでwarNameをapp_nameに変えるならば、それから、あなたのベースURLはhttp://app_name-namespace.rhcloud.com/app_nameになるでしょう。

Note: If you are building locally you'll also want to add any output wars/ears under deployments
from the build to your .gitignore file.
注:ローカルでビルドしているならば、あなたはビルドから.gitignoreファイルまでdeploymentsの下にどんなwars/earsでも加えたくもあります。

or
もしくは

2) You can git push prebuilt wars (with the corresponding .dodeploy file for exploded wars) into deployments/.
あなたは、前もってビルドされたwars(展開されたwarsのための対応する.dodeployファイルで)をdeployments/にgit pushすることができます。
To do this with the default repo you'll want to first run 'git rm -r src/ pom.xml' from the root of your repo.
デフォルトのリポジトリでこうするために、あなたはリポジトリのルートから最初に『git rm-r src/pom.xml』を走らせたいです。

Basic workflows for deploying prebuilt content (each operation will require associated git add/commit/push operations to take effect):
前もってビルドしておいたコンテンツを展開するための基本的なワークフロー(各々の活動は実施されることを合同git add/commit/push活動に要求します):

A) Add new zipped content and deploy it:
圧縮されたコンテンツを追加して、デプロイする

1. cp target/example.war deployments/

B) Add new unzipped content and deploy it:
圧縮されていないコンテンツを追加して、デプロイする

1. cp -r target/example.war/ deployments/
2. touch deployments/example.war.dodeploy

C) Undeploy currently deployed content:
現在デプロイされているコンテンツを、アンデプロイする

1. git rm deployments/example.war.dodeploy deployments/example.war

D) Replace currently deployed zipped content with a new version and deploy it:
現在デプロイされている圧縮コンテンツを、新バージョンに更新してデプロイする

1. cp target/example.war deployments/

E) Replace currently deployed unzipped content with a new version and deploy it:
現在デプロイされている非圧縮コンテンツを、新バージョンに更新してデプロイする

1. git rm -rf deployments/example.war/
2. cp -r target/example.war/ deployments/
3. touch deployments/example.war.dodeploy

WARNING:  If you go with option 2) there are a couple issues to keep in mind with both prebuilt and exploded wars.
警告: あなたがオプション2)を伴うならば、前もってビルドしておかれて分解WARsで心を閉じ込めるために、2つの問題があります。
With exploded wars the main issue is with committing binaries (class and jar files) can make merge conflicts tedious.
主要な問題がバイナリ(クラスとJarファイル)を反することである分解WARsで、製造は退屈な紛争を合併することができます。
With prebuilt wars the main issue is each time you modify the war and git push, it takes up the size of the war file away from your OpenShift file system quota.
あなたがWARとgit pushを修正するたびに、主要な問題がそうである前もって建設しておかれた戦争で、それはあなたのOpenShiftファイルシステム割当てから離れて戦争ファイルの寸法を取ります。
One alternative to this (other then using Maven from option 1) is to use rsync to push your war into the deployments folder.
これ(それからオプション1からMavenを利用している他)に1つの代わるものは、あなたのWARを配備フォルダに押し込むためにrsyncを使うことです。
You would have to do this after each git push followed by 'rhc app restart -a appname'.
『rhc app restart -a appname』が続く各々のgit pushの後、あなたはこうしなければならないでしょう。
Example:
例:
rsync -avz localdir/deployments/ app_uuid@appname-namespace.rhcloud.com:~/appname/repo/deployments/

Note: You can get the information in the uri above from running 'rhc domain show'
注: あなたは、『rhc domain show』を走らせることから、上のuriで、情報を得ることができます
If you have already committed large files to your git repo, you rewrite or reset the history of those files in git to an earlier point in time and then 'git push --force' to apply those changes on the remote OpenShift server.
GIT REPOに大きなファイルをすでに委託したならば、あなたは初期の時までGITでそれらのファイルの歴史を書き直すか、リセットします、そして、それらを適用する『git push --force 』は遠隔OpenShiftサーバーで変わります。
A git gc on the remote OpenShift repo can be forced with (Note: tidy also does other cleanup including clearing log files and tmp dirs):
遠いOpenShift買い戻し特約に関するGCが強制されることができるクズ(注: 背おおいも、ログファイルとtmp dirsをすっきりさせることを含む他のクリーンアップをします):

rhc app tidy -a appname

Whether you choose option 1) or 2) the end result will be the application deployed into the deployments directory.
あなたがオプション1)または2)を選ぶかどうかにかかわらず、結果は配備ディレクトリに配備されるアプリケーションです。
The deployments directory in the JBoss Application Server distribution is the location end users can place their deployment content (e.g. war, ear, jar, sar files) to have it automatically deployed into the server runtime.
JBoss Application Server配布の配備ディレクトリは、エンドユーザーが置くことができる場所です自動的にそれをサーバー実行時に配備しておくだけで満足している(例えばWAR、EAR、JAR、SARファイル)彼らの配備。

The filesystem deployment scanner in AS 7 and later works differently from previous JBoss AS releases.
AS 7とそれ以後のファイルシステム配備スキャナは、前のJBoss ASリリースと違って動きます。
The scanner will no longer attempt to directly monitor the deployment content and decide if or when the end user wishes the content to be deployed.
エンドユーザーが内容が展開されることを望むならばあるいは、そうするとき、スキャナはもはや直接配備内容をモニターして、決めようとしません。
Instead, the scanner relies on a system of marker files, with the user's addition or removal of a marker file serving as a sort of command telling the scanner to deploy, undeploy or redeploy content.
その代わりに、展開するか、非展開するか、内容を移動させるようにスキャナに言っている一種の命令として用いられているマーカーファイルのユーザーの追加または除去で、スキャナは目印ファイルのシステムに頼ります。

The marker files always have the same name as the deployment content to which they relate, but with an additional file suffix appended.
さらなるファイル拡張子を追加して、以外、マーカーファイルには、彼らが心を通わせる配備内容と同じ名前が常にあります。
For example, the marker file to indicate the example.war should be deployed is named example.war.dodeploy.
たとえば、example.warが配備されなければならないことを示すマーカーファイルは、example.war.dodeployという名前をつけられます。
Different marker file suffixes have different meanings.
異なるマーカーファイル拡張子は、異なる意味を持ちます。

The relevant marker file types are:
関連したマーカーファイルタイプは以下の通りです:

.dodeploy     -- Placed by the user to indicate that the given content should
                 be deployed into the runtime (or redeployed if already
                 deployed in the runtime.)
 実行時(または、すでに実行時に展開されるならば、移動させました。)に、所定の内容が展開されなければならないことを示すために、ユーザーによって置かれます

.deploying    -- Placed by the deployment scanner service to indicate that it
                 has noticed a .dodeploy file and is in the process of
                 deploying the content. This marker file will be deleted when
                 the deployment process completes.
それが.dodeployファイルに注意して、内容を展開するところのことを示すために、配備スキャナ・サービスによって置かれます。 配備プロセスが完了するとき、このマーカーファイルは削除されます。
             
.deployed     -- Placed by the deployment scanner service to indicate that the
                 given content has been deployed into the runtime. If an end
                 user deletes this file, the content will be undeployed.
所定の内容が実行時に展開されたことを示すために、配備スキャナ・サービスによって置かれます。 エンドユーザーがこのファイルを削除するならば、内容は展開していません。
              
.faileddeploy -- Placed by the deployment scanner service to indicate that the
                 given content failed to deploy into the runtime. The content
                 of the file will include some information about the cause of
                 the failure.
所定の内容が実行時に展開することができなかったことを示す配備スキャナ・サービスによって置かれます。 ファイルの内容は、失敗の原因に関する若干の情報を含みます。

.undeploying  -- Placed by the deployment scanner service to indicate that it
                 has noticed a .deployed file has been deleted and the
                 content is being undeployed. This marker file will be deleted
                 when the undeployment process completes.
それが.deployedファイルが削除された、そして、内容が展開していないと気がついたことを示すために、配備スキャナ・サービスによって置かれます。 非配備プロセスが完了するとき、この目印ファイルは削除されます。
             
.undeployed   -- Placed by the deployment scanner service to indicate that the
                 given content has been undeployed from the runtime. If an end
                 user deletes this file, it has no impact.
所定の内容が実行時から展開していなかったことを示すために、配備スキャナ・サービスによって置かれます。 エンドユーザーがこのファイルを削除するならば、それには影響がありません。


Environment Variables
環境変数
=====================

OpenShift provides several environment variables to reference for ease
of use.
OpenShiftは、使いやすさのためにいくつか環境変数参照提供します。
The following list are some common variables but far from exhaustive:
以下のリストは若干の一般の変数であるが、決して徹底的でありません:

    System.getenv("OPENSHIFT_GEAR_NAME")  - Application name
    System.getenv("OPENSHIFT_GEAR_DIR")   - Application dir
    System.getenv("OPENSHIFT_DATA_DIR")  - For persistent storage (between pushes)
    System.getenv("OPENSHIFT_TMP_DIR")   - Temp storage (unmodified files deleted after 10 days)

When embedding a database using 'rhc app cartridge add', you can reference environment
variables for username, host and password:
『rhc app cartridge add』を用いてデータベースを埋めるとき、あなたはユーザー名、ホストとパスワードのために環境変数にリファレンスをつけることができます:

    System.getenv("OPENSHIFT_DB_HOST")      - DB host
    System.getenv("OPENSHIFT_DB_PORT")      - DB Port
    System.getenv("OPENSHIFT_DB_USERNAME")  - DB Username
    System.getenv("OPENSHIFT_DB_PASSWORD")  - DB Password

To get a full list of environment variables, simply add a line in your
.openshift/action_hooks/build script that says "export" and push.
環境変数の全リストを得るために、単に「輸出」を言うあなたの.openshift/action_hooks/造りスクリプトで線を加えて、押してください。

0 件のコメント:

コメントを投稿