推荐工作流 OpenShift 用于带有一些私有文件的开源存储库 [英] Recommended workflow OpenShift for open source repo with some private files

查看:61
本文介绍了推荐工作流 OpenShift 用于带有一些私有文件的开源存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

OpenShift 似乎鼓励开发人员将 repo 直接推送到 OpenShift,这非常方便.如果一个应用程序(使用 node.js,但对于这个问题来说可能并不重要)主要是公共文件,但有一些私有文件,如数据库密码、外部 api 密钥、许可证密钥、New Relic 配置等.,推荐的部署方式是什么?

OpenShift seems to encourage developers to push a repo directly to OpenShift, which is pretty convenient. If an application (using node.js, but that probably doesn't matter much for this question) has mostly public files, but a few private files for things like DB passwords, external api keys, license keys, New Relic config, etc., what is the recommended way of deploying?

想到的一个想法是拥有 1 个公共存储库、1 个私有存储库和一个将所有内容放在一起的部署脚本,提交到一个单独的私有部署存储库,然后将该部署存储库推送到 OpenShift.

One idea that comes to mind is to have 1 public repo, 1 private repo, and a deploy script that puts everything together, commits to a separate private deploy repo, and then push that deploy repo to OpenShift.

这似乎是一个常见的用例,所以如果 OpenShift 已经有一个流程,那么带有额外 repo 的部署脚本可能是不必要的.

This seems like it would be a common use case though, so perhaps the deploy script with extra repo is unnecessary if OpenShift already has a process for this.

推荐答案

推荐的方法是使用环境变量来处理诸如 db 密码和密钥之类的事情.除非您同时将代码复制到公共 github 存储库,否则您推送到 OpenShift 托管的 git 存储库的所有内容都仅供您个人使用.

The recommended way is to use environment variables for things like db passwords and keys. And unless you are also copying your code to a public github repo, then everything you push to your OpenShift hosted git repo is private to just you.

这篇关于推荐工作流 OpenShift 用于带有一些私有文件的开源存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆