官术网_书友最值得收藏!

Specifying your own template Git repository URL

In the Creating an OpenShift application using the rhc command-line client recipe, we created an application that used a template source code provided by OpenShift. Let's suppose you want OpenShift to use your Git repository to populate the initial contents of the application. This can be accomplished using the --from-code option at application creation time.

Getting ready

To complete this recipe, you will need the rhc command-line client installed on your machine. Please refer to the Installing the OpenShift rhc command-line client recipe in Chapter 1, Getting Started with OpenShift, for details. You should also complete the setup on your OpenShift account using rhc by following the Setting up an OpenShift account using rhc recipe in Chapter 1, Getting Started with OpenShift.

How to do it…

To create an application that uses initial content from your own Git repository, use the--from-code option:

$ rhc create-app javaapp jbosseap-6 --from-code https://github.com/OpenShift-Cookbook/chapter3-recipe2.git

Note

The Git repository URL should be a public Git repository; otherwise, application creation will fail as OpenShift cannot access the repository.

How it works…

When you create an OpenShift application using the --from-code option, the OpenShift server will first clone the Git repository provided with the --from-code option and then use that repository source code to populate the initial contents of the application. The Git repository URL should be a public Git repository; otherwise, OpenShift will not be able to clone the repository and will instead raise an exception. Following this, OpenShift will build the source code, create an artifact, and then deploy the artifact to the server. An artifact is a by-product produced during the development of software, for example, in the case of Java applications, it could be either a Java Archive (JAR), Web Archive (WAR), or Enterprise Archive (EAR) file.

In the previous command, we created a JBoss EAP application that used a public Git repository URL as its initial code. After the application is successfully created, you can view the application running at http://javaapp-{domain-name}.rhcloud.com/. The application is a simple demonstration of the article extraction library called Boilerpipe (which you can access at https://code.google.com/p/boilerpipe/). It takes a URL and gives you the title and relevant text from the URL.

See also

  • The Creating a WordPress application using the web console recipe in Chapter 1, Getting Started with OpenShift
  • The Creating an OpenShift application using the rhc command-line client recipe
主站蜘蛛池模板: 钟山县| 长宁区| 宝清县| 出国| 鲁山县| 靖州| 巴林右旗| 合山市| 丰宁| 文化| 万全县| 阿拉善左旗| 贡觉县| 延川县| 英超| 高雄市| 南昌县| 葫芦岛市| 舒兰市| 舟曲县| 济阳县| 响水县| 石家庄市| 扶余县| 吉木萨尔县| 玉门市| 分宜县| 井陉县| 双峰县| 定兴县| 恩平市| 建宁县| 龙山县| 凤翔县| 额尔古纳市| 尼木县| 大安市| 烟台市| 万源市| 伊吾县| 长乐市|