HOW TO UPGRADE GHOST ON OPENSHIFT

First congratulations for the release of Ghost 0.4.2 this week!

As the title indicates, this post is not about how to install Ghost on OpenShift, it’s about how to upgrade it.

Installing Ghost on OpenShift is quite easy with the quickstart script while upgrading it is not so straight forward. It really took me some time to figure out how to upgrade it in the OpenShift way.

Yes, the OpenShift way, the best practice to upgrade Ghost on OpenShift, which is the git way.

The Git Way

OpenShift utilize git for source code management. Upgrading Ghost means updating its source code.

To upgrade Ghost in the OpenShift way, you need to pull the source code from OpenShift server, update it with the latest Ghost source, then push it back to OpenShift server. If you are familiar with git, you may already know how to do it properly. If you’re not, here are the details.

You may want to get yourself familiar with git by reading this simple guide first.

Step 1: Pull the source code from OpenShift server to local machine

For Linux users, simply type the following command to checkout the repository.

git clone ssh://your-openshift-repo-url

You can get the URL of the repository from the OpenShift application console.

If you already have the repository cloned, you can run git pull to update your local tree.

Step 2: Update the working directory with the latest Ghost source

Download the latest version of Ghost, extract the files directly to the directory of your local tree. By doing this, all existing files will be up to date and all new files will be added. For Linux users, simply type the following command.

unzip -uo ghost-latest.zip -d path-to-your-git-repo

Step 3: Edit package.json

We need to change the line

"main": "./core/index"

to

"main": "index.js"

in package.json.

This step is a must, otherwise it won’t work on OpenShift.

Step 4: Stage all changes

Run the following command to make all changes staged.

git add .

If you are not confident, you can run git add -i to review all changes.

Step 5: Commit the changes

After all these changes we’ve made, we must commit them to the head tree by the following command.

git commit -m ‘upgrade to ghost 0.4.2‘

Step 6: Push it back to OpenShift

Here comes the final step, just run

git push

Upon running this command, OpenShift will take care of everything else and redeploy the application. After the command finishes, your new Ghost will be ready to go.

Conclusion

Although OpenShift provides ssh access by which you can make changes directly on remote server, git should always be your first consideration.

Whenever you want to make changes for your application, it is better to work in your local tree and then push back to OpenShift. That’s the work flow suggested by OpenShift.

For example if you want to install a new theme for Ghost, extract the theme files to the proper directory in your local tree, then do a git add, git commit and git push. That is the best practice.

时间: 2024-10-13 14:08:35

HOW TO UPGRADE GHOST ON OPENSHIFT的相关文章

个人ghost博客搭建

关于Blog建立 本Blog的建立过程: 买域名 域名购买有很多选择,本站域名在godaddy购买,只买了域名,没有买主机和虚拟空间. 买VPS主机 虚拟主机仍然有很多选择,之前用国外的DigitalOcean,现在改用了国内的Qing Cloud. DigitalOcean的优点是价格便宜,SSD硬盘存储快,但国内使用的缺点就是网速太慢. QingCloud是国内的一家云服务创业企业,较阿里云等相对便宜,且操控台简洁方便,且能快速水平扩展,且支持负载均衡等,个人认为比较适合个人使用或创业公司.

[转载]github在线更改mysql表结构工具gh-ost

GitHub正式宣布以开源的方式发布gh-ost:GitHub的MySQL无触发器在线更改表定义工具! gh-ost是GitHub最近几个月开发出来的,目的是解决一个经常碰到的问题:不断变化的产品需求会不断要求更改MySQL表结构.gh-ost通过一种影响小.可控制.可审计.操作简单的方案来改变线上表结构. 在介绍gh-ost之前,我们先了解一下各种现有方案,以及为什么要自己开发一个新工具. 已有的在线修改表定义方案 目前,在线修改表定义的任务主要是通过这三种途径完成的: 在从库上修改表定义,修

新版OpenShift空间申请使用教程-安装WordPress,Mysql及绑定域名,文件管理

OpenShift空间是Red Hat的平台即服务的云计算平台(PaaS),自成立以来就为大家提供免费空间服务,深受到国内外用户的欢迎.虽然全世界的免费云空间商从2010年开始就如雨后春笋般地出现,但是真正能够从激烈的竞争环境中生存下来的也就是那几个实力雄厚的公司的产品. Amazon EC2.Google Compute Engine.Windows Azure是我们熟知的亚马逊.谷歌和微软三家网络巨头公司云计算服务产品,都为我们提供的空间和VPS主机的试用服务,但是很遗憾的就是这三家公司的云

Ghost文件封装说明

一.先列举目前Windows系统安装方式: 1.光盘安装 1.1 使用可刻录光驱将系统ISO文件刻录至DVD光盘,刻录工具比较多,QA目前使用Ultra ISO. 1.2 安装电脑从DVD光盘启动,无内置光驱电脑使用USB外置式接口光驱. 1.3 进入安装界面,选择安装语言.安装版本等配置信息,有些手动输入安装序列号,直至电脑copy安装文件.安装系统. 1.4 安装完成,第一次进入桌面前,需要进行Personalize.System Setting.Your account等设置. 如果是XP

Debian 8.x / Ubuntu 16.04.x 搭建 Ghost 教程

Ghost 是一款使用 Node.js 开发的博客系统,相对于使用 PHP 开发的 WordPress 更轻巧友好,所以本站已经从 WordPress 切换至 Ghost,本文介绍在 Debian 8.x 和 Ubuntu 16.04 下搭建 Ghost 的教程 本文所有操作均在 root 用户下进行,请自行切换 首先,更新系统 apt-get update && apt-get upgrade 如果您用的 Debian 8.x 开启了 backports 也可以更新下 apt-get -

OpenShift helm的安装

1.安装过程 下载addons的代码 $ git clone https://github.com/jorgemoralespou/minishift-addons $ cd minishift-addons 因为helm的tiller要求访问gcr的地址,因此把地址替换成ericnie2017后建立 ericdeMacBook-Pro:helm ericnie$ cat helm.addon # Name: helm # Description: Installs helm # Pull th

OCP Upgrade from 3.6 to 3.7

有个好文档还是靠普很多,感谢同事的文档.升级步骤记录如下 1.检查现有环境 [[email protected] ~]# etcd --version etcd Version: 3.2.22 Git SHA: 1674e68 Go Version: go1.9.2 Go OS/Arch: linux/amd64 [[email protected] ~]# etcdctl2 cluster-health member a4e80e96ea75f7c8 is healthy: got healt

OpenShift跨版本升级

官方的in-place upgrade直接在线升级,但问题是只能一个一个版本的升无法做到跨版本升级,如果一次跨越多个版本,并且集群规模比较大的化,就需要花费很长的时间了. 实际生产过程中因为是分布式环境,所以机器量一般都比较大,官方升级模式有一个好处就是始终能够对外提供服务. 问题是连续升级的时间消耗比较长,而且容易出问题.而这篇文章的方法是,直接安装新的集群模式,同时将原有的旧节点覆盖成新的版本. 1.原有集群备份 基于每个project备份 先列一下有啥东西 [[email protecte

给虚拟机安装GHOST版本的windows系统

今天需要装XP系统到虚拟机做实验,首先下载了ISO镜像,发现网上大多ISO镜像都是GHOST版本的,并非原生态安装版本.遇到以下问题: 1.加载ISO镜像,进行安装时错误提示A:\ghosterr.txt 如下图: 这个错误是由于VMware并没有事先将虚拟机的磁盘进行分区,所以没有主引导MBR,导致GHOST无法安装.那么需要先将虚拟机磁盘建立MBR:但实际操作又遇到问题:虚拟机如果第一次加载ISO不直接安装系统而是启动DiskGinus进行分区,建立MBR操作后,第二次虚拟机就不会主动加载I