Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed mac os issues #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions bin/aws-code-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ installAwsCli() {
runCommand "sudo pip install awscli"
}

installCoreUtils() {
h2 "Installing CoreUtils"
runCommand "HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install coreutils"
success "Installing CoreUtils succeeded"
}

vercomp() {
if [[ $1 == $2 ]]
then
Expand Down Expand Up @@ -170,6 +176,7 @@ fi
# Check AWS is installed
h1 "Step 1: Checking Dependencies"


if ! typeExists "aws"; then
installAwsCli
success "Installing AWS CLI $(aws --version 2>&1) succeeded"
Expand All @@ -184,10 +191,17 @@ else
fi

success "Dependencies met $(aws --version 2>&1)"
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
if ! typeExists "greadlink"; then
installCoreUtils
success "Installing CoreUtils succeeded"
fi
fi




# ----- Configure -----
# see documentation
# http://docs.aws.amazon.com/cli/latest/reference/configure/index.html
Expand Down Expand Up @@ -330,7 +344,13 @@ fi
# ----- Application Source -----
h1 "Step 6: Checking Application Source"
AWS_CODE_DEPLOY_APP_BUNDLE_TYPE=${AWS_CODE_DEPLOY_APP_BUNDLE_TYPE:-zip}
APP_SOURCE=$(readlink -f "${AWS_CODE_DEPLOY_APP_SOURCE:-.}")
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
APP_SOURCE=$(readlink -f "${AWS_CODE_DEPLOY_APP_SOURCE:-.}")
elif [[ "$OSTYPE" == "darwin"* ]]; then
APP_SOURCE=$(greadlink -f "${AWS_CODE_DEPLOY_APP_SOURCE:-.}")
else
APP_SOURCE=$(realpath -f "${AWS_CODE_DEPLOY_APP_SOURCE:-.}")
fi

if [ ! -d "$APP_SOURCE" -a ! -e "$APP_SOURCE" ]; then
# Note: Use original variable for output as the readlink can potentially evaluate to ""
Expand Down Expand Up @@ -457,7 +477,8 @@ else
success "Successfuly removed $(($S3_TOTAL_FILES-$S3_DEPLOY_LIMIT)) file(s)"
break
fi
FILE_LINE=$(expr "$line" : '^.*[0-9]\{2\}\:[0-9]\{2\}\:[0-9]\{2\}[ ]\+[0-9]\+[ ]\+\(.*\)$')
#FILE_LINE=$(expr "$line" : '^.*[0-9]\{2\}\:[0-9]\{2\}\:[0-9]\{2\}[ ]\+[0-9]\+[ ]\+\(.*\)$')
FILE_LINE=`(echo $line | awk '{$1=$2=$3=""; print $0}' | sed 's/^[ \t]*//')`
runCommand "aws s3 rm \"s3://$S3_FULL_BUCKET/$FILE_LINE\""
((S3_NUMBER_FILES_TO_CLEAN--))
done
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "aws-code-deploy",
"version": "1.0.11",
"name": "@vshsolutions/aws-code-deploy",
"version": "1.0.13",
"description": "Bash script to easily deploy applications with AWS Code Deploy.",
"author": "TechPivot",
"main": "bin/aws-code-deploy.sh",
"bin": {
"bin": {
"aws-code-deploy": "./bin/aws-code-deploy.sh"
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/techpivot/aws-code-deploy.git"
"url": "git+ssh://[email protected]:vshsolutions/aws-code-deploy.git"
},
"license": "MIT",
"keywords": [
Expand Down