=====================================================================

--- New Scripts --------------------------

zsh )
  vundle-vim helpers
   - vim/vundle/edit-build-actions
   - vim/vundle/install
   - vim/vundle/rebuild

  quick install-from-source scripts
   - git/package/install
   - git/package/build    (install --only-build)
   - git/package/download (install --only-pull)
   - git/package/update   (install --update)

  config sym-linker (for source-controlled .configs)
   - config/update    (symlinks + terminfo)
   - config/symlinks  (set all symlinks from settings)
   - config/settings  (edit settings which aren't scwrypts env variables)
   - config/terminfo  (load all terminfo from settings)

--- Changes ------------------------------

- helper comments are now inserted in all env files
- removed underscore prefix for standard AWS environment variables
- added "opening" and "finished editing" comments to __EDIT util
- added __USAGE to format $USAGE variable to std:err
- added __ERROR_CHECK to exit if any __ERROR(s) were called
This commit is contained in:
2022-08-15 18:30:37 -06:00
parent a740a66870
commit 6333a2f6b8
34 changed files with 472 additions and 49 deletions

View File

@ -3,11 +3,11 @@ _DEPENDENCIES+=(
jq
)
_REQUIRED_ENV+=(
_AWS_ACCOUNT
_AWS_PROFILE
_AWS_REGION
AWS_ACCOUNT
AWS_PROFILE
AWS_REGION
)
source ${0:a:h}/../common.zsh
#####################################################################
_AWS() { aws --profile $_AWS_PROFILE --region $_AWS_REGION --output json $@; }
_AWS() { aws --profile $AWS_PROFILE --region $AWS_REGION --output json $@; }

View File

@ -9,6 +9,6 @@ __STATUS "performing AWS ECR docker login"
_AWS ecr get-login-password | docker login \
--username AWS \
--password-stdin \
"$_AWS_ACCOUNT.dkr.ecr.$_AWS_REGION.amazonaws.com" \
&& __SUCCESS "logged in to 'AWS:$_AWS_ACCOUNT:$_AWS_REGION'" \
|| __FAIL 1 "unable to login to '$_AWS_ACCOUNT' in '$_AWS_REGION'"
"$AWS_ACCOUNT.dkr.ecr.$AWS_REGION.amazonaws.com" \
&& __SUCCESS "logged in to 'AWS:$AWS_ACCOUNT:$AWS_REGION'" \
|| __FAIL 1 "unable to login to '$AWS_ACCOUNT' in '$AWS_REGION'"

View File

@ -5,7 +5,7 @@ source ${0:a:h}/../common.zsh
GET_DATABASE_CREDENTIALS() {
local PRINT_PASSWORD=0
local ARGS_ERRORS=0
local ERRORS=0
while [[ $# -gt 0 ]]
do
@ -13,12 +13,13 @@ GET_DATABASE_CREDENTIALS() {
--print-password ) PRINT_PASSWORD=1 ;;
* )
__WARNING "unrecognized argument $1"
ARGS_ERRORS+=1
ERRORS+=1
;;
esac
shift 1
done
[[ $ARGS_ERRORS -ne 0 ]] && return 1
__ERROR_CHECK
##########################################

View File

@ -13,7 +13,7 @@ _ROUTE53_BACKUP() {
for DOMAIN in $(_ROUTE53_GET_DOMAINS)
do
( __STATUS "creating '$BACKUP_PATH/$DOMAIN.txt'" \
&& cli53 export --profile $_AWS_PROFILE $DOMAIN > "$BACKUP_PATH/$DOMAIN.txt" \
&& cli53 export --profile $AWS_PROFILE $DOMAIN > "$BACKUP_PATH/$DOMAIN.txt" \
&& __SUCCESS "backed up '$DOMAIN'" \
|| __ERROR "failed to back up '$DOMAIN'" \
) &
@ -25,7 +25,7 @@ _ROUTE53_BACKUP() {
}
_ROUTE53_GET_DOMAINS() {
cli53 list --profile $_AWS_PROFILE \
cli53 list --profile $AWS_PROFILE \
| awk '{print $2;}' \
| sed '1d; s/\.$//'\
;