From 3f354c93c48cb941dac1117ea59075aa0cfbc031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 23 Nov 2018 19:56:51 +0100 Subject: [PATCH] asciiblaster-www/: added to repository. .gitignore: ignore asciiblaster-www/releases/*. asciiblaster-{cordoba,nw,www}/deploy.sh, assets/shell/: melp? index.html: add version to . --- .gitignore | 1 + asciiblaster-cordoba/deploy.sh | 1 + asciiblaster-nw/deploy.sh | 1 + asciiblaster-www/assets | 1 + asciiblaster-www/deploy.sh | 1 + asciiblaster-www/index.html | 1 + assets/shell/deploy-all.sh | 38 +++++++++++ .../shell/deploy-cordoba.sh | 6 +- .../release.sh => assets/shell/deploy-nwjs.sh | 6 +- assets/shell/deploy-www.sh | 66 +++++++++++++++++++ index.html | 2 +- 11 files changed, 117 insertions(+), 7 deletions(-) create mode 120000 asciiblaster-cordoba/deploy.sh create mode 120000 asciiblaster-nw/deploy.sh create mode 120000 asciiblaster-www/assets create mode 120000 asciiblaster-www/deploy.sh create mode 120000 asciiblaster-www/index.html create mode 100755 assets/shell/deploy-all.sh rename asciiblaster-cordoba/release.sh => assets/shell/deploy-cordoba.sh (95%) rename asciiblaster-nw/release.sh => assets/shell/deploy-nwjs.sh (97%) create mode 100755 assets/shell/deploy-www.sh diff --git a/.gitignore b/.gitignore index 0557dcb..5a6a8df 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ asciiblaster-cordoba/platforms/android/app/build asciiblaster-cordoba/platforms/android/CordovaLib/build asciiblaster-cordoba/releases/* asciiblaster-nw/releases/* +asciiblaster-www/releases/* diff --git a/asciiblaster-cordoba/deploy.sh b/asciiblaster-cordoba/deploy.sh new file mode 120000 index 0000000..911b705 --- /dev/null +++ b/asciiblaster-cordoba/deploy.sh @@ -0,0 +1 @@ +../assets/shell/deploy-cordoba.sh \ No newline at end of file diff --git a/asciiblaster-nw/deploy.sh b/asciiblaster-nw/deploy.sh new file mode 120000 index 0000000..d6f9707 --- /dev/null +++ b/asciiblaster-nw/deploy.sh @@ -0,0 +1 @@ +../assets/shell/deploy-nwjs.sh \ No newline at end of file diff --git a/asciiblaster-www/assets b/asciiblaster-www/assets new file mode 120000 index 0000000..ec2e4be --- /dev/null +++ b/asciiblaster-www/assets @@ -0,0 +1 @@ +../assets \ No newline at end of file diff --git a/asciiblaster-www/deploy.sh b/asciiblaster-www/deploy.sh new file mode 120000 index 0000000..882a98b --- /dev/null +++ b/asciiblaster-www/deploy.sh @@ -0,0 +1 @@ +../assets/shell/deploy-www.sh \ No newline at end of file diff --git a/asciiblaster-www/index.html b/asciiblaster-www/index.html new file mode 120000 index 0000000..79c5d6f --- /dev/null +++ b/asciiblaster-www/index.html @@ -0,0 +1 @@ +../index.html \ No newline at end of file diff --git a/assets/shell/deploy-all.sh b/assets/shell/deploy-all.sh new file mode 100755 index 0000000..201ce70 --- /dev/null +++ b/assets/shell/deploy-all.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# + +msgf() { + local _fmt="${1}"; shift; + printf "%s >>> ${_fmt}\n" "$(date +"%d-%^b-%Y %H:%M:%S")" "${@}"; +}; + +usage() { + echo "usage: ${0} [-h] [-v]" >&2; + echo " -h.........: show this screen" >&2; + echo " -v.........: be verbose" >&2; +}; + +main() { + local _cmd="" _build="" _opt="" _vflag=0; + while getopts hv _opt; do + case "${_opt}" in + h) usage; exit 0; ;; + v) _vflag=1; ;; + *) usage; exit 1; ;; + esac; done; + shift $((${OPTIND}-1)); + for _build in cordoba nwjs www; do + msgf "Deploying ${_build}..."; + if [ "${_vflag:-0}" -eq 0 ]; then + ./assets/shell/deploy-${_build}.sh "${@}"; + else + ./assets/shell/deploy-${_build}.sh -v "${@}"; + fi; + msgf "Deployed ${_build}."; + done; +}; + +set -o errexit -o noglob; +main "${@}"; + +# vim:foldmethod=marker sw=8 ts=8 tw=120 diff --git a/asciiblaster-cordoba/release.sh b/assets/shell/deploy-cordoba.sh similarity index 95% rename from asciiblaster-cordoba/release.sh rename to assets/shell/deploy-cordoba.sh index 7e2a3bb..a0b641c 100755 --- a/asciiblaster-cordoba/release.sh +++ b/assets/shell/deploy-cordoba.sh @@ -21,7 +21,7 @@ subst() { echo "${_string_}"; }; -release() { +deploy() { local _platform="${1}" _vflag="${2}" _release_dname_src="" _release_type="" _release_version=""; _release_dname_src="$(subst "${RELEASES_DNAME_SRC}" "%CORDOBA_PLATFORM%" "${_platform}")"; @@ -65,9 +65,9 @@ main() { for _platform in ${_platforms:-${CORDOBA_PLATFORMS}}; do msgf "Building ${_platform} release..."; if [ "${_vflag:-0}" -eq 0 ]; then - release "${_platform}" "${_vflag}" >/dev/null; + deploy "${_platform}" "${_vflag}" >/dev/null; else - release "${_platform}" "${_vflag}"; + deploy "${_platform}" "${_vflag}"; fi; msgf "Built ${_platform} release."; done; diff --git a/asciiblaster-nw/release.sh b/assets/shell/deploy-nwjs.sh similarity index 97% rename from asciiblaster-nw/release.sh rename to assets/shell/deploy-nwjs.sh index 553c1b9..35cccee 100755 --- a/asciiblaster-nw/release.sh +++ b/assets/shell/deploy-nwjs.sh @@ -35,7 +35,7 @@ subst() { echo "${_string_}"; }; -release() { +deploy() { local _platform="${1}" _vflag="${2}" _nwjs_fname="" _nwjs_subdir="" _nwjs_url="" \ _release_fname="" _release_dname="" _release_version=""; @@ -107,9 +107,9 @@ main() { for _platform in ${_platforms:-${NWJS_PLATFORMS}}; do msgf "Building ${_platform} release..."; if [ "${_vflag:-0}" -eq 0 ]; then - release "${_platform}" "${_vflag}" >/dev/null; + deploy "${_platform}" "${_vflag}" >/dev/null; else - release "${_platform}" "${_vflag}"; + deploy "${_platform}" "${_vflag}"; fi; msgf "Built ${_platform} release."; done; diff --git a/assets/shell/deploy-www.sh b/assets/shell/deploy-www.sh new file mode 100755 index 0000000..c8b08de --- /dev/null +++ b/assets/shell/deploy-www.sh @@ -0,0 +1,66 @@ +#!/bin/sh +# + +PACKAGE_NAME="asciiblaster-www"; +RELEASE_DEPS="cpio find gzip rm sed tar"; +RELEASES_DNAME="releases"; + +msgf() { + local _fmt="${1}"; shift; + printf "%s >>> ${_fmt}\n" "$(date +"%d-%^b-%Y %H:%M:%S")" "${@}"; +}; + +deploy() { + local _vflag="${1}" _release_fname="" _release_dname="" _release_version=""; + + _release_version="$(sed -n '/^\s*<title>/s/^\s*<title>asciiblaster v\([0-9.]\+\)<\/title>\s*$/\1/p' index.html)"; + _release_dname="${RELEASES_DNAME}/${PACKAGE_NAME}-${_release_version}"; + _release_fname="${_release_dname}.tgz"; + + find -L . \ + -mindepth 1 \ + -not -path "./${RELEASES_DNAME}/*" \ + -not -path "./${RELEASES_DNAME}" \ + -not -name '*.sw*' \ + -not -name "${0##*/}" |\ + cpio --quiet -dLmp "${_release_dname}"; + tar -C "${RELEASES_DNAME}" -cpf - \ + "${_release_dname##${RELEASES_DNAME}/}" |\ + gzip -c - > "${_release_fname}"; + rm -fr "${_release_dname}"; +}; + +usage() { + echo "usage: ${0} [-h] [-v]" >&2; + echo " -h.........: show this screen" >&2; + echo " -v.........: be verbose" >&2; +}; + +main() { + local _cmd="" _opt="" _vflag=0; + while getopts hv _opt; do + case "${_opt}" in + h) usage; exit 0; ;; + v) _vflag=1; ;; + *) usage; exit 1; ;; + esac; done; + shift $((${OPTIND}-1)); + for _cmd in ${RELEASE_DEPS}; do + if ! which "${_cmd}" >/dev/null; then + echo "error: missing prerequisite command \`${_cmd}'"; + exit 1; + fi; + done; + msgf "Building release..."; + if [ "${_vflag:-0}" -eq 0 ]; then + deploy "${_vflag}" >/dev/null; + else + deploy "${_vflag}"; + fi; + msgf "Built release."; +}; + +set -o errexit -o noglob; +main "${@}"; + +# vim:foldmethod=marker sw=8 ts=8 tw=120 diff --git a/index.html b/index.html index d5ee136..868107a 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ <html> <head> <meta charset="UTF-8"> -<title>asciiblaster +asciiblaster v1.0.3