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

  • OpenShift Cookbook
  • Shekhar Gulati
  • 402字
  • 2021-08-05 17:37:41

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
主站蜘蛛池模板: 上饶市| 福泉市| 铅山县| 长白| 白玉县| 佛冈县| 巍山| 施甸县| 孙吴县| 扎囊县| 昆山市| 河西区| 西华县| 区。| 内黄县| 琼结县| 平山县| 临颍县| 阳朔县| 鄯善县| 仪征市| 巴东县| 布尔津县| 高碑店市| 安达市| 桓台县| 兰溪市| 通化县| 明水县| 太谷县| 廊坊市| 关岭| 沙洋县| 周宁县| 凤台县| 明溪县| 苏尼特左旗| 盐城市| 阿瓦提县| 武功县| 获嘉县|