如何对私人jelastic环境进行版本控制

编程入门 行业动态 更新时间:2024-10-11 09:21:27
本文介绍了如何对私人jelastic环境进行版本控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

为了跟踪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环境进行版本控制

本文发布于:2023-11-08 06:42:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1568626.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:私人   版本   环境   jelastic

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!