Script to create CI - continuous integration images for hugo deployment
Readme
The script takes in 1 argument, a directory containing already checked out repository of malvahq/ci-docker-hugo code.
It then downloads the latest releases of hugo through Github API v3.
For every release of hugo , it creates a local branch of ci-docker-hugo off master with the name of the branch being that of a hugo release, eg: 0.58.3, say.
In the second stage, it replaces the Dockerfile created off master branch with the specific version of the branch under discussion. After the changes, the new branch is pushed to the remote.
In the final stage, it merges the contents of origin/master to this branch to pick up any optimizations to the Dockerfile in master branch.
Warning: As can be seen above, the script is extremely dangerous and is considered a hack to keep up to the latest releases of hugo.
Do not bother using this script unless you know what you are doing as it can wreak havoc on your git repository, both local and remote.