为了跟踪Jelastic托管环境的配置,我想在git存储库中对其进行版本控制.该存储库应该是私有的,并包含多个具有不同版本的不同分支(例如 master , abc123 , v1.1 ).
In order to track the configuration of our Jelastic hosting environment, I would like to version it in a git repository. The repository is supposed to be private and contain several different branches with different versions (such as master, abc123, v1.1).
我的第一个尝试是创建一个包含以下内容的私有github存储库:
My first try was to create a private github repo containing:
- 一个 manifest.json ,用于描述环境的拓扑
- 一组配置文件,例如Web服务器配置,...
现在,我想知道:
A)如何将环境从私有git(hub)存储库导入Jelastic?我可以使用仪表板导入URL功能吗?还是我必须使用CLI?
A) How can I import an environment from a private git(hub) repository into Jelastic? Can I use the Dashboard Import URL feature to do so? Or do I have to use the CLI?
B)如何确保manifest.json引用与manifest.json本身版本相同的配置文件?如何通过凭证让Jelastic能够检索配置文件?
B) How can I make sure that the manifest.json refers to the configuration file of the same version as the manifest.json itself? How do I pass the credentials for Jelastic to be able to retrieve the configuration files?
我看过一种Jelastic示例环境: github/jelastic-jps/basic-examples/blob/master/automatic-environment-migration-after-cloning/manifest.jps
I had a look at one of the Jelastic sample environments: github/jelastic-jps/basic-examples/blob/master/automatic-environment-migration-after-cloning/manifest.jps
有:配置文件(例如alfresco-global.properties)是从公共 github存储库加载的.因此,manifest.json和配置文件都不需要凭据.此外,配置文件将始终从 master 分支加载.
There: The configuration files (e.g. alfresco-global.properties) are loaded from a public github repository. Therefore no credentials are required, neither for the manifest.json, nor for the configuration files. Additionally, the configuration files will always be loaded from the master branch.
相反,
- 我希望存储库是私有的
- 我想确保manifest.json的abc123版本将始终与配置文件的abc123版本一起部署.
这有可能吗?还有最佳实践吗?
Is this possible at all? And is there a best-practice?
推荐答案
A)如何从私有git(hub)存储库导入环境进入Jelastic?我可以使用仪表板导入URL功能吗?或者我必须使用CLI吗?
A) How can I import an environment from a private git(hub) repository into Jelastic? Can I use the Dashboard Import URL feature to do so? Or do I have to use the CLI?
B)如何确保manifest.json引用了与manifest.json本身版本相同的配置文件?我如何通过Jelastic的凭证才能检索到配置文件?
B) How can I make sure that the manifest.json refers to the configuration file of the same version as the manifest.json itself? How do I pass the credentials for Jelastic to be able to retrieve the configuration files?
要将环境从私有Github存储库导入Jelastic,您应该通过仪表板导入功能.
To import an environment from a private Github repository into Jelastic, you should import manifest file URL with token through Dashboard Import feature.
为此,您需要:
-
在Github上生成令牌 help.github/articles/creating-a-personal-access-token-for-the-command-line/
在清单文件中,应将令牌用于指向私有存储库的所有链接
in the manifest file, a token should be used for all links to the private repository
仪表板导入-> URL-> raw.githubusercontent/{user}/{repo}/{branch}/manifest.jps
Dashboard Import -> URL -> raw.githubusercontent/{user}/{repo}/{branch}/manifest.jps
清单文件示例:
type: install name: Test Private Repo baseUrl: raw.githubusercontent/{user}/{repo}/{branch} settings: fields: - name: token caption: Token type: string default: globals: token: ${settings.token} description: README.md?access_token=${globals.token} onInstall: # Shell script by URL - cmd: script.sh?access_token=${globals.token} # Base URL inside shell script - cmd: | wget '${baseUrl}/script.sh?access_token=${globals.token}' -O script.sh chmod +x script.sh ./script.sh # Javascript by URL - script: script.js?access_token=${globals.token}更多推荐
如何对私人jelastic环境进行版本控制
发布评论