Over a million developers have joined DZone.

How to update Ghost on Windows Azure

DZone's Guide to

How to update Ghost on Windows Azure

· Cloud Zone ·
Free Resource

Learn how to migrate and modernize stateless applications and run them in a Kubernetes cluster.

While trying Ghost I found myself in the need of updating the code to keep it up to date with the latest version available on github, and since both getting the updates and the deplyoment to Azure Web Sites is done via git I wrote a small batch file that automates the process.

#! /bin/bash
echo Pulling from Azure
git pull azure master
echo Pulling updates from origin
git pull origin
echo Compiling assets
grunt init
grunt prod
echo Committing to local repository
git commit -a -m "Applying changes from origin"
echo Pushing to Azure
git push azure master

A little explanation of what the script does:

  1. It pulls from Azure in case the site has been edited or updated already
  2. It pulls from the master of Ghost to get the latest changes
  3. Executes the grunt build file: compiles Sass, concat javascript files and finally mininfy them
  4. It commits to the local repository all the changes (including all the generated files)
  5. A finally pushes to git repository used by the Azure Web Site
Tags:  Ghost, azuregit

Join us in exploring application and infrastructure changes required for running scalable, observable, and portable apps on Kubernetes.


Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}