博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HOW TO UPGRADE GHOST ON OPENSHIFT
阅读量:5305 次
发布时间:2019-06-14

本文共 2973 字,大约阅读时间需要 9 分钟。

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  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.

转载于:https://www.cnblogs.com/chendeshen/p/4189953.html

你可能感兴趣的文章
Android面试收集录15 Android Bitmap压缩策略
查看>>
PHP魔术方法之__call与__callStatic方法
查看>>
ubuntu 安装后的配置
查看>>
web前端之路,js的一些好书(摘自聂微东 )
查看>>
【模板】对拍程序
查看>>
【转】redo与undo
查看>>
解决升级系统导致的 curl: (48) An unknown option was passed in to libcurl
查看>>
Java Session 介绍;
查看>>
spoj TBATTLE 质因数分解+二分
查看>>
Django 模型层
查看>>
dedecms讲解-arc.listview.class.php分析,列表页展示
查看>>
Extjs6 经典版 combo下拉框数据的使用及动态传参
查看>>
【NodeJS】http-server.cmd
查看>>
研磨JavaScript系列(五):奇妙的对象
查看>>
面试题2
查看>>
selenium+java iframe定位
查看>>
P2P综述
查看>>
第五章 如何使用Burp Target
查看>>
Sprint阶段测试评分总结
查看>>
sqlite3经常使用命令&语法
查看>>