You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to suggest incremental deployments, i.e., to only transfer differences to the server.
Problem:
In the current implementation, every deployment destroys the remote branche's history and wastes bandwith by uploading the entire site (instead of just uploading the differences). Technically, the ghpages deployment initializes a new git repo, packs the entire generated output into one commit, and force-pushes the branch to the remote. See the file src/ghpages.plugin.coffee.
Suggested improvement:
The ghpages plugin should not destroy history in the remote branch and should push a small, differential commit that contains changes only. I have set up a corresponding deployment shell script as follows.
#!/usr/bin/env bash# change into the script's directory
DIR="$(cd"$( dirname "${BASH_SOURCE[0]}")"&&pwd)"pushd$DIR> /dev/null
# configuration
OUT=out
# setup a clean git repo in ./out
git fetch --all
git fetch --tags
rm -rf $OUT
mkdir $OUT
cp -r .git $OUT/.git
pushd out > /dev/null
git checkout --track origin/master
git reset --hard origin/master
popd> /dev/null
# deploy to out folder
docpad generate --env static
# commit the out folder's contentspushd$OUT> /dev/null
git add -A --force
git commit -m "`date`"
git push -f
popd> /dev/null
# change back into the original working directorypopd> /dev/null
Future improvements upon the above script:
Some implicit assumptions contained in the above script are that: The website's source and output are managed in the same repository. The source is maintained in a branch src, the output is maintained in branch master.
Instead of bash / shellscript, a proper implementation as docpad plugin would be beneficial. But the shell script has proven sufficient for my goals.
The text was updated successfully, but these errors were encountered:
I want to suggest incremental deployments, i.e., to only transfer differences to the server.
Problem:
In the current implementation, every deployment destroys the remote branche's history and wastes bandwith by uploading the entire site (instead of just uploading the differences). Technically, the
ghpages
deployment initializes a new git repo, packs the entire generated output into one commit, and force-pushes the branch to the remote. See the filesrc/ghpages.plugin.coffee
.Suggested improvement:
The
ghpages
plugin should not destroy history in the remote branch and should push a small, differential commit that contains changes only. I have set up a corresponding deployment shell script as follows.Future improvements upon the above script:
src
, the output is maintained in branchmaster
.The text was updated successfully, but these errors were encountered: