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

Add tag deploy script and 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 %>
<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; = 'gauges-tracker';
t.setAttribute('data-site-id', '5b2862402149406994002c5e');
t.setAttribute('data-track-path', '');
t.src = '';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
\ No newline at end of file
printf "\n"
if [[ $1 = "" ]] ; then
printf "Missing tag name to deploy!\n"
printf "Usage: ./ <tag_name>\n"
# 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"
# 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"
printf "Deploy failed.\n"
eval $checkoutInitialBranch
printf "$checkoutCommand returned a non-successful status code. Exiting.\n"
eval $checkoutInitialBranch
\ 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