Commit 1bd6be40 authored by Frank Kumro's avatar Frank Kumro

Add tag deploy script and gaug.es visitor tracking code.

parent 8654d244
Pipeline #24107038 passed with stage
in 2 minutes and 13 seconds
......@@ -46,6 +46,21 @@
<%= render @view_module, @view_template, assigns %>
</main>
<script src="<%= static_path(@conn, "/js/app.js") %>"></script>
<script type="text/javascript">
var _gauges = _gauges || [];
(function () {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '5b2862402149406994002c5e');
t.setAttribute('data-track-path', 'https://track.gaug.es/track.gif');
t.src = 'https://d2fuc4clr7gvcn.cloudfront.net/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
\ No newline at end of file
#!/bin/bash
printf "\n"
if [[ $1 = "" ]] ; then
printf "Missing tag name to deploy!\n"
printf "Usage: ./tag_deploy.sh <tag_name>\n"
exit
fi
# Save the branch name of the branch we were on before deploy. This enables
# us to be nice and checkout that branch post deploy
initialBranch=`git branch | grep \* | cut -d ' ' -f2`
checkoutInitialBranch="git checkout $initialBranch"
# Confirm with the user that this is indeed the tag to deploy.
printf "Tag to deploy: [$1]\n"
read -p "Are you sure you wish to deploy (y/n)? " answer
shopt -s nocasematch # case insentitive matching may save you one day
if [[ $answer =~ ^(n|no)$ ]] ; then
printf "\nEject eject eject!!\n"
exit
fi
# Checkout tag
checkoutCommand="git checkout $1"
if eval $checkoutCommand; then
# checkout was successful
printf "Tag checked out, starting deploy.\n"
nanoboxDeploy="nanobox deploy -m 'Deployment of git tag: [$1]'"
if eval $nanoboxDeploy; then
printf "Deploy sucessful, monitor status from your dashboard!\n"
else
printf "Deploy failed.\n"
fi
eval $checkoutInitialBranch
else
printf "$checkoutCommand returned a non-successful status code. Exiting.\n"
eval $checkoutInitialBranch
exit
fi
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment