Skip to content

Commit

Permalink
add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
npfoss committed Feb 29, 2020
1 parent ede7801 commit d3b7a4a
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# To run this script you must have *in your athena locker*:
# - 'aklog' written in ~/.bash_environment (or the environment file for whatever shell you use)
# - 'sipb' and 'athena' written in ~/.xlog.
# Otherwise, you will not have permission to access the courseroad locker,
# even if you are on courseroad-dev@.

#syntax: ./deploy.sh [dev|prod] [kerberos]

# this section is for Miriam's kdo setup
if [ $SHELL = "/bin/zsh" ]; then
source ~/.zshrc
fi
# To run this script you must have 'aklog' written in ~/.bash_environment
# (or the environment file for whatever shell you use)
# and 'sipb' and 'athena' written in ~/.xlog (both of these files should be in your athena locker).
# Otherwise, you will not have permission to access the courseroad locker,
# even if you are on courseroad-dev.

#syntax: ./deploy.sh [dev or prod] [kerberos]
# exit if anything errors
set -e

npm run build-$1
Expand All @@ -19,15 +23,16 @@ if [ "$1" = "prod" ]; then
if which aklog &>/dev/null; then
echo "AFS detected, using AFS for deployment"
if which kdo &>/dev/null; then
echo "Using kdo"
echo "Using kdo"
kdo $2 aklog sipb
else
kinit -f -l 1h $2
aklog sipb
kinit -f -l 1h $2
aklog sipb
fi
rsync --delete --progress --checksum -r deploy/production/.htaccess dist/* /afs/sipb.mit.edu/project/courseroad/web_scripts/courseroad/
else
echo "Could not locate AFS, using SSH for deployment"
# this is what happens without any fancy setup
scp -r deploy/production/.htaccess dist/* $2@athena.dialup.mit.edu:/mit/courseroad/web_scripts/courseroad/
fi
else
Expand All @@ -47,6 +52,7 @@ elif [ "$1" = "dev" ]; then
rsync --delete --progress --checksum -r deploy/development/.htaccess dist/* /afs/sipb.mit.edu/project/courseroad/web_scripts/courseroad/dev/
else
echo "Could not locate AFS, using SSH for deployment"
# this is what happens without any fancy setup
scp -r deploy/development/.htaccess dist/* $2@athena.dialup.mit.edu:/mit/courseroad/web_scripts/courseroad/dev/
fi
else
Expand Down

0 comments on commit d3b7a4a

Please sign in to comment.