removed aws/s3/sync-media; this is now part of scwrypts
This commit is contained in:
parent
0a4924b70b
commit
cb6e15ca08
19
bin/aws/configure
vendored
19
bin/aws/configure
vendored
@ -1,19 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
source "$HOME/.config/wryn/env.zsh"
|
|
||||||
source $ZSH_COLOR_UTIL
|
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
CONFIGURE() {
|
|
||||||
CHECK "checking for '$DOTWRYN_AWS_PROFILE' aws credentials"
|
|
||||||
grep -q "^\\[$DOTWRYN_AWS_PROFILE\\]$" "$HOME/.aws/credentials" \
|
|
||||||
&& { OK; return 0 } || WARN
|
|
||||||
|
|
||||||
USER_PROMPT "set up credentials now? [Y/n]"
|
|
||||||
READ_K yn
|
|
||||||
[[ $yn =~ ^[nN] ]] && return 1
|
|
||||||
|
|
||||||
aws --profile $DOTWRYN_AWS_PROFILE configure
|
|
||||||
}
|
|
||||||
|
|
||||||
CONFIGURE
|
|
@ -1,58 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
source "$HOME/.config/wryn/env.zsh"
|
|
||||||
source $ZSH_COLOR_UTIL
|
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
pull ) PULL=1 ;;
|
|
||||||
push ) PUSH=1 ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case $2 in
|
|
||||||
delete ) DELETE=1 ;; # whether or not to pass '--delete' to s3 sync
|
|
||||||
# default is not to delete
|
|
||||||
esac
|
|
||||||
|
|
||||||
[ ! $PULL ] && [ ! $PUSH ] && FATAL 'must specify "pull" or "push"'
|
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
PULL_MEDIA() {
|
|
||||||
local REMOTE_TARGET="s3://$S3_SYNC_BUCKET/$1"
|
|
||||||
local LOCAL_TARGET="$HOME/$1"
|
|
||||||
local FLAGS=()
|
|
||||||
|
|
||||||
[ ! -d $LOCAL_TARGET ] && mkdir -p $LOCAL_TARGET
|
|
||||||
|
|
||||||
local DELETE="$2"
|
|
||||||
[ $DELETE ] && FLAGS+=--delete
|
|
||||||
|
|
||||||
CHECK "downloading latest $1"
|
|
||||||
aws --profile $DOTWRYN_AWS_PROFILE \
|
|
||||||
s3 sync $REMOTE_TARGET $LOCAL_TARGET \
|
|
||||||
$FLAGS \
|
|
||||||
&& OK || WARN
|
|
||||||
}
|
|
||||||
|
|
||||||
PUSH_MEDIA() {
|
|
||||||
local REMOTE_TARGET="s3://$S3_SYNC_BUCKET/$1"
|
|
||||||
local LOCAL_TARGET="$HOME/$1"
|
|
||||||
local FLAGS=()
|
|
||||||
|
|
||||||
local DELETE="$2"
|
|
||||||
[ $DELETE ] && FLAGS+=--delete
|
|
||||||
|
|
||||||
CHECK "uploading $1"
|
|
||||||
aws --profile $DOTWRYN_AWS_PROFILE \
|
|
||||||
s3 sync $LOCAL_TARGET $REMOTE_TARGET \
|
|
||||||
$FLAGS \
|
|
||||||
&& OK || WARN
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for m in $S3_SYNC_MEDIA
|
|
||||||
do
|
|
||||||
[ $PULL ] && PULL_MEDIA $m $DELETE
|
|
||||||
[ $PUSH ] && PUSH_MEDIA $m $DELETE
|
|
||||||
done
|
|
Loading…
Reference in New Issue
Block a user