diff options
author | Bill <bill@billserver.senders.io> | 2021-02-06 13:22:21 -0500 |
---|---|---|
committer | Bill <bill@billserver.senders.io> | 2021-02-06 13:22:21 -0500 |
commit | e3ababf35a565e3ee60079a9d347387d3a59d652 (patch) | |
tree | 32f522534ef5d0ae132248bcf49ba1e2f791ff8f /deploy.sh | |
parent | 436e68d02d47b5575fb3e8a0c6bd843161d4f5e6 (diff) |
Clean-up no longer needed assets and files
Diffstat (limited to 'deploy.sh')
-rwxr-xr-x | deploy.sh | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index cbfb505..0000000 --- a/deploy.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env bash -set -e - -# Stolen from: https://stackoverflow.com/questions/3878624/how-do-i-programmatically-determine-if-there-are-uncommitted-changes -require_clean_work_tree () { - # Update the index - git update-index -q --ignore-submodules --refresh - err=0 - - # Disallow unstaged changes in the working tree - if ! git diff-files --quiet --ignore-submodules -- - then - echo >&2 "cannot $1: you have unstaged changes." - git diff-files --name-status -r --ignore-submodules -- >&2 - err=1 - fi - - # Disallow uncommitted changes in the index - if ! git diff-index --cached --quiet HEAD --ignore-submodules -- - then - echo >&2 "cannot $1: your index contains uncommitted changes." - git diff-index --cached --name-status -r --ignore-submodules HEAD -- >&2 - err=1 - fi - - if [ $err = 1 ] - then - echo >&2 "Please commit or stash them." - exit 1 - fi -} - -## ## -# MAIN METHOD # -## ## -DATE=$(date -u -Iseconds) -DATE_TAG=$(date -u +%Y.%m.%dT%H.%M.%SZ) - -echo "Checking git for clean work tree" -require_clean_work_tree - -echo "Updating version file" -echo "Deployed on: $DATE" > www/version.txt -docker run --rm -it -v ${PWD}/www:/www:ro amazon/aws-cli s3 cp /www s3://senders.io/ --recursive -echo "Deployed!" - -echo "Committing deploy" -git commit -am "Deployed: $DATE" -git tag -a $DATE_TAG -m "Deployed to s3 on $DATE" - -echo "Pushing to git" -git push origin master --tags -echo "Done!" - |