Updating your Ghost blog with Git (GANDI)
2 min read

Updating your Ghost blog with Git (GANDI)

Below you will find how to update a Ghost application on Gandi with Git. It is our own tutorial and we are not developers, be forgiving.
Updating your Ghost blog with Git (GANDI)

When we started this blog, with wrote a tutorial to help people install a Ghost blog on their own installation using Git. Today, a reader reported to us that we did not share how to update your ghost installation (thank's Thijs). Thus, below you will find how to update a Ghost application on Gandi with Git.

The prerequisite

This tutorial is for people that followed the installation of a Ghost blog on Gandi. So you have a Simple Hosting instance up and running. Your domain (or sub-domain) is running fine as well.

You will need to download the last release of Ghost. Currently our blog is running on the last version '3.17.1'.

The process we will explain below is to update your Ghost local folder to the new version and next push it to Gandi (commit, push, deploy). The difficult point in this manual update is to remember which files and folders you modified on your first installation.

On the undisclosed blog, we made 2 changes on the original Ghost package:

  • The production settings file (point 5 of the previous tutorial)
  • & the Casper theme was modified to simplify the footer (you can do it editing the default.hbs file)

1. Make a save

Duplicate your ghost local folder as a backup. You can add a "_old" next to the folder name for example.

2. Unzip the new Ghost package

We prefer to keep it in our download folder in order to keep this folder far away from the actual ghost folder and its save.

3. Modify the new Ghost package

We simply copy-paste the config.production.json from our Ghost installation to the new package. Copy it in the same spot, for us it is: /Users/vincent/ghost/core/server/config/env/config.production.json

Edit: From Ghost version 3.18, the config folder (which contain the  important config.production.json file) is now located in this folder: /Users/vincent/ghost/core/shared/config/env/config.production.json

Remember we modified the Casper theme as well. But as it is actively developed, we recommend that you make the changes you want manually on the new themes files (and not copy-paste from the old package).

Note for MacOS users: for editing .hbs files, we use Coda 2 from Panic. Panic are currently launching their new Nova app (more powerful than Coda 2).

4. Copy-paste you new package modified above

In your Ghost local installation, replace every file and folder with the new package you just modified on your download folder.

5. Commit, push, and deploy

Note: for MacOS users, the Terminal works fine but we use iTerm2.

Now you're ready to commit the code to your local repository, push the changes to the remote repository, and then deploy the code. Launch the Terminal.

Write the shortcut to your ghost git installation: cd ghost/

Write (do not forget the point '.'): git add .

Write (edit the 'text' with accurate comment like '3.17.1'): git commit -am 'comment about the update'

Write: git push gandi master

Enter your Gandi Instance password

Write: ssh [instance_login]@git.[datacenter].gpaas.net deploy default.git

Enter your Gandi Instance password

Let the build finish (wait for the last step 'the cleaning files' to end).

That gives:

$ git add .
$ git commit -am '3.17.1'
$ git push gandi master
$ ssh [instance_login]@git.[datacenter].gpaas.net deploy default.git

The End

Wait a minute and you can navigate to your blog on your favorite browser (we suggest Firefox). We hope this tutorial helps you update you Ghost blog. Feel free to email us if you need more information.

Enjoying these posts? Subscribe for more