曾今看到 stackoverflow 上的一篇介绍关于如何在 OpenShift 更新 Ghost 的,总觉得哪里不对。果然,自己的方案显得更加简洁。
请先确认,在创建 Application 的时候你选择的是 Instant App
中的 Ghost
,抑或是说你新建的 Node.js 应用直接使用的是 git@github.com:openshift-quickstart/openshift-ghost-quickstart.git
来预创建的,否则本文不适合你。
#include <std_disclaimer.h>
/*
* Your warranty is now void.
*
* We're not responsible for unreachable website, lost data,
* thermonuclear war, or you getting fired because the deployment failed. Please
* do some research if you have any concerns about features included in this instructions
* before following it! YOU are choosing to make these modifications, and if
* you point the finger at us for messing up your server, we will laugh at you.
*
*/
备份数据
打开 your-blog-url/ghost/settings/labs/
选择 EXPORT
导出你的博客文本,如有必要,请使用 ssh 登录备份你的全部媒体数据。如果你的操作将来有偏差,说数据已经丢失了,把我批判一番,概不负责。
步骤
-
先把自己的 Repository 克隆下来,.git 地址可以在 https://openshift.redhat.com/app/console/application/ 查看。
比如这样
git clone ssh://55212f08fcf933e14f000081@ghost-legend.rhcloud.com/~/git/ghost.git/
-
git fetch git@github.com:openshift-quickstart/openshift-ghost-quickstart.git
-
若无出错,按照提示执行
git merge master FETCH_HEAD
-
git push origin master
等待自动部署 -
ENJOY!
如有 OpenShift 环境操作疑问,请移步官方 User Guide