[英]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.