Last active
February 15, 2021 14:10
-
-
Save guleriagishere/411303ad33e3dc0f6a36910c4181f6c3 to your computer and use it in GitHub Desktop.
random bash script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SUBDOMAIN_SUFFIX=$1 | |
REGION=$2 | |
# Get list of directories modified in current commit. | |
LIST_OF_DIRS=$(git diff --dirstat=files,0 HEAD~1 | awk '{print $2}' | cut -d '/' -f 1 | uniq) | |
CURR_DIR=$(echo $(pwd)) | |
for i in $LIST_OF_DIRS | |
do | |
cd $CURR_DIR | |
cd $i | |
echo "current dir is $(pwd)" | |
echo $SUBDOMAIN_SUFFIX | |
npm install | |
npm run build | |
S3_BUCKET=$i-$SUBDOMAIN_SUFFIX | |
aws s3 cp build s3://$S3_BUCKET/ --recursive --region $REGION | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment