[build.sh] Updated build script to remove debug eval command.

[build.sh] Build script now has 'env' file at head and 'parser' file tail
[cmd_deploy] Now uses the _OPT_DB_FILE variable instead of DB_FILE
[cmd_deploy] now generates imageidList using DB_FILE if imageid not provided by user
[cmd_exclude] Rewrote to operate as front end to db_set's exclude function
[cmd_include] Added as front end to db_set's include function
[cmd_update] Fixed some typos
[db_set] Added as backend to DB_FILE trackid selection
[env] Now defines _OPT_DB_FILE as .dam.db
[parser] Updates parser to support cmd_deploy, cmd_include, cmd_exclude and cmd_update
[print_meta_mtag] Last line now does not trail with ";" character
This commit is contained in:
ayakael 2018-03-28 19:26:38 -04:00
parent e05faf010f
commit d3c141cbd8
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026
10 changed files with 108 additions and 78 deletions

View file

@ -10,45 +10,19 @@ case "${1}" in
cmd_exclude ${@}
;;
init)
include)
shift
cmd_init ${@}
cmd_include ${@}
;;
deploy)
shift
TARGET="${1}"; shift
imageidList=($(printf '%s\n' ${@} | sed 's/\(.*\)\..*/\1/'))
cmd_deploy ${TARGET} ${imageidList[@]}
cmd_deploy ${@}
;;
update)
shift
TARGET="${1}"; shift
LAST_COMMIT="${TARGET}/${LAST_COMMIT}"
NEW_COMMIT=$(git rev-parse HEAD)
OLD_COMMIT=$(grep COMMIT "${LAST_COMMIT}" | cut -d'=' -f2)
imageidList=($(sed 's/\(.*\)\..*/\1/' <<< $(git diff --name-only ${NEW_COMMIT} ${OLD_COMMIT}) | awk '!seen[$0]++' | grep SHA256))
echo $LAST_COMMIT
echo $NEW_COMMIT
echo $OLD_COMMIT
echo ${imageidList[@]}
cmd_deploy ${TARGET} ${imageidList[@]}
case $? in
0)
_msg ECHO "Update completed succesfully"
sed -i "s/COMMIT=.*/COMMIT=${NEW_COMMIT}/" ${LAST_COMMIT}
;;
1)
_msg ECHO "Missing exclude, manifest or exclude file. Please make sure you init"
;;
2)
_msg ECHO "Update completed with errors. Please review and deploy problematic images manually."
sed -i "s/COMMIT=.*/COMMIT=${NEW_COMMIT}/" ${LAST_COMMIT}
;;
esac
cmd_update ${@}
;;
esac