[*]Migrated all deploy_ functions to export_
This commit is contained in:
parent
1c2371a266
commit
d86a2d3860
9 changed files with 33 additions and 33 deletions
|
@ -8,7 +8,7 @@
|
|||
# USAGE
|
||||
# chk_metadata </path/to/git/dir> </path/to/target> </path/to/db/file> [<IMAGEID>] [<...>]
|
||||
#
|
||||
# DEPENDENCIES bunc/src/* src/deploy_meta
|
||||
# DEPENDENCIES bunc/src/* src/export_meta
|
||||
#
|
||||
# }
|
||||
|
||||
|
@ -23,7 +23,7 @@ chk_metadata() {
|
|||
local COUNT=1
|
||||
for imageid in ${imageidList[@]}; do
|
||||
echo "[ ${COUNT} / ${#imageidList[@]} ] Checking ${imageid} in ${TARGET}"
|
||||
deploy_meta "${GIT_DIR}" "${TARGET}" "${DB_FILE}" ${imageid} >${STDERR} 2>&1
|
||||
export_meta "${GIT_DIR}" "${TARGET}" "${DB_FILE}" ${imageid} >${STDERR} 2>&1
|
||||
[[ $? -eq 0 ]] || { echo "[>>>>>>] Error reported"; cat ${STDERR}; local ERR=true; }
|
||||
local COUNT=$(( ${COUNT} + 1 ))
|
||||
done
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
# USAGE
|
||||
# cmd_export - </path/to/git/dir> </path/to/target> [<old git commit>]
|
||||
#
|
||||
# DEPENDENCIES bunc/src/* src/print_imageid_du src/deploy_rm src/deploy_cp src/deploy_meta
|
||||
# DEPENDENCIES bunc/src/* src/print_imageid_du src/export_rm src/export_cp src/export_meta
|
||||
#
|
||||
# }
|
||||
|
||||
|
@ -47,7 +47,7 @@ cmd_export() {
|
|||
local COUNT=1
|
||||
for removableid in ${removableidList[@]}; do
|
||||
echo "[ ${COUNT} / ${#removableidList[@]} ] Removing ${removableid}"
|
||||
deploy_rm "${TARGET}" "${DB_FILE}" ${removableid} >${STDERR} 2>&1
|
||||
export_rm "${TARGET}" "${DB_FILE}" ${removableid} >${STDERR} 2>&1
|
||||
[[ $? -eq 0 ]] || { echo "[>>>>>>] Error reported"; cat ${STDERR}; local ERR=true; }
|
||||
local COUNT=$(( ${COUNT} + 1 ))
|
||||
done
|
||||
|
@ -64,7 +64,7 @@ cmd_export() {
|
|||
local GIT_GET=true
|
||||
[[ $? -ne 0 ]] && { _ansi up 2; echo -en '\033[K'; echo "[ ${COUNT} / ${#updateableidList[@]} ] ${imageid} could not be downloaded from server"; cat ${STDERR}; local ERR=true; continue; }
|
||||
fi
|
||||
deploy_cp "${GIT_DIR}" "${TARGET}" "${DB_FILE}" ${imageid} > ${STDERR} 2>&1
|
||||
export_cp "${GIT_DIR}" "${TARGET}" "${DB_FILE}" ${imageid} > ${STDERR} 2>&1
|
||||
[[ $? -ne 0 ]] && local CP_ERR=true
|
||||
[[ "${GIT_GET}" == "true" ]] && git -C "${GIT_DIR}" annex drop ${imageid}.flac >/dev/null 2>&1
|
||||
[[ "${CP_ERR}" == "true" ]] && { _ansi up 2; echo -en '\033[K'; echo "[ ${COUNT} / ${#updateableidList[@]} ] Copy of ${imageid} completed with errors"; cat ${STDERR}; local ERR=true; continue; }
|
||||
|
@ -72,7 +72,7 @@ cmd_export() {
|
|||
|
||||
|
||||
# Processes metadata changes
|
||||
deploy_meta "${GIT_DIR}" "${TARGET}" "${DB_FILE}" ${imageid} >${STDERR} 2>&1
|
||||
export_meta "${GIT_DIR}" "${TARGET}" "${DB_FILE}" ${imageid} >${STDERR} 2>&1
|
||||
[[ $? -eq 0 ]] && { _ansi up 2; echo -en '\033[K'; echo "[ ${COUNT} / ${#updateableidList[@]} ] Deployment of ${imageid} completed successfully"; }
|
||||
[[ $? -ne 0 ]] && { _ansi up 2; echo -en '\033[K'; echo "[ ${COUNT} / ${#updateableidList[@]} ] Application of metadata of ${imageid} completed with errors"; cat ${STDERR}; }
|
||||
done
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
# doc deploy_cp {
|
||||
# doc export_cp {
|
||||
#
|
||||
# DESCRIPTION
|
||||
# deploy_cp - Deploys IMAGEIDs to TARGET using files from GITDIR, for when TRACKID has
|
||||
# export_cp - Deploys IMAGEIDs to TARGET using files from GITDIR, for when TRACKID has
|
||||
# never been deployed to TARGET before.
|
||||
#
|
||||
# USAGE
|
||||
# deploy_cp </path/to/git/dir> </path/to/target> </path/to/db/file> <IMAGEID>
|
||||
# export_cp </path/to/git/dir> </path/to/target> </path/to/db/file> <IMAGEID>
|
||||
#
|
||||
# DEPENDENCIES bunc/src/* src/deploy_gen src/deploy_mv
|
||||
# DEPENDENCIES bunc/src/* src/export_gen src/export_mv
|
||||
#
|
||||
# }
|
||||
|
||||
deploy_cp() {
|
||||
export_cp() {
|
||||
## Argument parsing
|
||||
local GIT_DIR="${1}"
|
||||
local TARGET="${2}"
|
||||
|
@ -23,9 +23,9 @@ deploy_cp() {
|
|||
|
||||
## Splits IMAGEID into TRACKIDs
|
||||
_msg EXEC "Splitting ${IMAGEID}"
|
||||
deploy_gen "${GIT_DIR}" ${IMAGEID} >${STDERR} 2>&1
|
||||
export_gen "${GIT_DIR}" ${IMAGEID} >${STDERR} 2>&1
|
||||
[[ $? -ne 0 ]] && _msg WARN
|
||||
deploy_mv "${GIT_DIR}" ${IMAGEID} >${STDERR} 2>&1
|
||||
export_mv "${GIT_DIR}" ${IMAGEID} >${STDERR} 2>&1
|
||||
[[ $? -eq 0 ]] && _msg OK || _msg WARN
|
||||
|
||||
## Transfers selected TRACKIDs to TARGET
|
|
@ -1,17 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
# doc deploy_gen {
|
||||
# doc export_gen {
|
||||
#
|
||||
# DESCRIPTION
|
||||
# deploy_gen - Splits specified image into multiple files using a text file
|
||||
# export_gen - Splits specified image into multiple files using a text file
|
||||
# formatted under the CUE specification
|
||||
#
|
||||
# USAGE
|
||||
# deploy_gen </path/to/git/dir> <IMAGEID>
|
||||
# export_gen </path/to/git/dir> <IMAGEID>
|
||||
#
|
||||
# }
|
||||
|
||||
deploy_gen() {
|
||||
export_gen() {
|
||||
local GITDIR="${1}"
|
||||
local IMAGEID="${2}"
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
# doc deploy_meta {
|
||||
# doc export_meta {
|
||||
#
|
||||
# DESCRIPTION
|
||||
# deploy_meta - Makes the deployment of metadata in TARGET consistent with GIT_DIR
|
||||
# export_meta - Makes the deployment of metadata in TARGET consistent with GIT_DIR
|
||||
#
|
||||
# USAGE
|
||||
# deploy_meta <path/to/git/dir> <path/to/target> <path/to/db/file> <IMAGEID>
|
||||
# export_meta <path/to/git/dir> <path/to/target> <path/to/db/file> <IMAGEID>
|
||||
#
|
||||
# DEPENDENCIES bunc/src/* src/print_mtag_trackno src/print_meta_mtag src/print_future_path src/print_present_path src/print_meta_flac
|
||||
#
|
||||
# }
|
||||
|
||||
deploy_meta() {
|
||||
export_meta() {
|
||||
## Argument parsing
|
||||
local GIT_DIR="${1}"
|
||||
local TARGET="${2}"
|
|
@ -1,15 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
# doc deploy_mv {
|
||||
# doc export_mv {
|
||||
#
|
||||
# DESCRIPTION
|
||||
# deploy_mv - Renames output files from deploy_gen to associated TRACKID
|
||||
# export_mv - Renames output files from export_gen to associated TRACKID
|
||||
#
|
||||
# USAGE
|
||||
# deploy_mv </path/to/git/dir> <IMAGEID.
|
||||
# export_mv </path/to/git/dir> <IMAGEID.
|
||||
# }
|
||||
|
||||
deploy_mv() {
|
||||
export_mv() {
|
||||
local GITDIR="${1}"
|
||||
local IMAGEID="${2}"
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
# doc deploy_rm {
|
||||
# doc export_rm {
|
||||
#
|
||||
# DESCRIPTION
|
||||
# deploy_rm - Removes TRACKIDs from TARGET
|
||||
# export_rm - Removes TRACKIDs from TARGET
|
||||
#
|
||||
# USAGE
|
||||
# deploy_rm </path/to/target> </path/to/db/file> <TRACKID>
|
||||
# export_rm </path/to/target> </path/to/db/file> <TRACKID>
|
||||
#
|
||||
# DEPENDENCIES bunc/src/* src/print_present_path
|
||||
#
|
||||
# }
|
||||
|
||||
deploy_rm() {
|
||||
export_rm() {
|
||||
## Argument parsing
|
||||
local TARGET="${1}"
|
||||
local DB_FILE="${2}"
|
|
@ -8,7 +8,7 @@
|
|||
# USAGE
|
||||
# gen_trackid </path/to/flac/file> </path/to/cue/fule>
|
||||
#
|
||||
# DEPENDENCIES src/deploy_gen
|
||||
# DEPENDENCIES src/export_gen
|
||||
#
|
||||
# }
|
||||
|
||||
|
@ -16,7 +16,7 @@ gen_trackid() {
|
|||
FLAC="${1}"
|
||||
CUE="${2}"
|
||||
|
||||
deploy_gen ${FLAC} ${CUE} >/dev/null 2>&1
|
||||
export_gen ${FLAC} ${CUE} >/dev/null 2>&1
|
||||
local TOTALTRACKS="$(grep -e "TRACK [0-9][0-9] AUDIO" "${CUE}" | wc -l)"
|
||||
|
||||
local COUNT=1
|
||||
|
|
|
@ -81,7 +81,7 @@ case "${1}" in
|
|||
[[ ${EXIT} -eq 2 ]] && echo "Git directory not a valid git repository"
|
||||
;;
|
||||
|
||||
deploy)
|
||||
export)
|
||||
shift
|
||||
while [[ -n "${1}" ]]; do
|
||||
case ${1} in
|
||||
|
@ -97,7 +97,7 @@ case "${1}" in
|
|||
;;
|
||||
esac
|
||||
done
|
||||
cmd_deploy "${GIT_DIR}" "${TARGET}" "${OLD_COMMIT}"
|
||||
cmd_export "${GIT_DIR}" "${TARGET}" "${OLD_COMMIT}"
|
||||
EXIT=$?
|
||||
[[ ${EXIT} -eq 0 ]] && echo "Deployment completed successfully"
|
||||
[[ ${EXIT} -eq 1 ]] && echo "Deployment completed with errors"
|
||||
|
|
Loading…
Reference in a new issue