簡體   English   中英

在Openshift中將現有應用程序的git repo與新應用程序一起使用

[英]Use an git repo from an existing app with a new app in openshift

我在openshift中創建了一個使用我的一些代碼的應用程序。 這是一個django項目。 我希望能夠使用他們的REST API創建一個新應用,但要使該新應用使用現有存儲庫作為源代碼。 可能嗎? 在我的openshift Web控制台中,在現有應用程序部分中,它提供一個URL,並要求我將其復制到git clone。 網址是這種形式

ssh://a_very_large_string@appname-domain.rhcloud.com/~/git/appname.git/

我這樣使用REST API調用

curl -k -X POST https://openshift.redhat.com/broker/rest/domains/rhombus/applications --user "username:password" --data "name=client1&cartridge=python-2.7&scale=false&gear_profile=small&initial_git_url=ssh://a_ver_large_string@appname-domain.rhcloud.com/~/git/appname.git/"

但是我得到的響應如下:

{"api_version":1.7,
 "data":null,
 "messages":[{"exit_code":216,"field":"initial_git_url",
              "index":null,
              "severity":"error",
              "text":"Invalid initial git URL"}
    ],
 "status":"unprocessable_entity",
 "supported_api_versions":[1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7],
 "type":null,
 "version":"1.7"}

如何獲取git repo url以在新應用程序中使用它?

在命令行中,您可以輸入rhc apps以獲取有關現有應用程序的所有信息-包括git URL。

如果要查看文檔,請參見以下頁面: https : //access.redhat.com/site/documentation/zh-CN/OpenShift_Online/2.0/html/User_Guide/Viewing_Applications_for_a_User.html

您可能也對克隆現有應用程序的文章感興趣。

這篇StackOverflow帖子還包括有關在OpenShift上將現有git repo用於新應用程序的說明。 我還沒有嘗試過,但是看起來很有希望。 (相關信息在第一個答案中,但有一些下降,因此您需要略讀才能找到它。)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM