From 3c4e223d8a3ccb52225948ee2a8275a48896631d Mon Sep 17 00:00:00 2001 From: escapace Date: Tue, 8 Nov 2022 17:40:06 +0000 Subject: [PATCH] v3.9.0 --- .github/workflows/pipeline.yml | 4 ++-- manage | 14 ++++++++------ modules/manage/parseYAML | 8 ++++---- modules/manage/run | 6 +++--- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 0d0a28c..1ac910d 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -63,12 +63,12 @@ jobs: if: contains(github.ref, 'tags/v') shell: bash run: | - echo ${DOCKER_PASSWORD} | docker login -u ${DOCKER_USERNAME} --password-stdin + echo ${DOCKER_ACCESS_TOKEN} | docker login -u ${DOCKER_USERNAME} --password-stdin docker build -t escapace/manage:latest -t escapace/manage:${GITHUB_REF:11} . docker push escapace/manage:latest docker push escapace/manage:${GITHUB_REF:11} env: - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }} DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} release: name: "Github Release" diff --git a/manage b/manage index 2a09b25..d475229 100755 --- a/manage +++ b/manage @@ -33,7 +33,7 @@ else exit 1 fi -MANAGE_VERSION="v3.8.1" +MANAGE_VERSION="v3.9.0" MANAGE_IS_CI () { # Returns 0 if the current environment @@ -462,7 +462,7 @@ MANAGE_REPOSITORY_PATH () { MANAGE_ERROR notRepository "${repository}" } - modulePath="$(yq r "${directory}/.manage.yml" --defaultValue "scripts/modules" directories.module)" + modulePath="$(yq '.directories.module // "scripts/modules"' "${directory}/.manage.yml")" modulePath="${directory}/${modulePath}" [ ! -d "${modulePath}" ] && { @@ -887,6 +887,9 @@ MANAGE_ARCH () { i386) arch="386" ;; + arm64) + arch="arm64" + ;; aarch64) arch="arm64" ;; @@ -929,13 +932,13 @@ MANAGE_OS () { } MANAGE_GET_YQ() { - local version="3.2.1" + local version="4.29.2" local url local binary="${MANAGE_BIN}/yq" local localVersion local download="true" - url="https://github.com/mikefarah/yq/releases/download/${version}/yq_$(MANAGE_OS)_$(MANAGE_ARCH)" + url="https://github.com/mikefarah/yq/releases/download/v${version}/yq_$(MANAGE_OS)_$(MANAGE_ARCH)" if [[ -f "${binary}" ]] then @@ -950,7 +953,6 @@ MANAGE_GET_YQ() { if [[ "${download}" == "true" ]] then - { if [[ "${MANAGE_INTERACTIVE}" == "true" ]] then @@ -962,7 +964,7 @@ MANAGE_GET_YQ() { chmod +x "${MANAGE_BIN}/yq" - [[ "$("${MANAGE_BIN}/yq" --version)" == "yq version ${version}" ]] &> /dev/null || MANAGE_ERROR yq "${url}" + [[ "$("${MANAGE_BIN}/yq" --version)" == "yq (https://github.com/mikefarah/yq/) version ${version}" ]] &> /dev/null || MANAGE_ERROR yq "${url}" fi } diff --git a/modules/manage/parseYAML b/modules/manage/parseYAML index 8863194..3929780 100644 --- a/modules/manage/parseYAML +++ b/modules/manage/parseYAML @@ -3,10 +3,10 @@ # shellcheck disable=SC2034 parseYAML () { - MANAGE_SCRIPT_DIRECTORY="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" --defaultValue scripts directories.scripts)" + MANAGE_SCRIPT_DIRECTORY="$(yq '.directories.scripts // "scripts"' "${MANAGE_REPOSITORY}/.manage.yml")" MANAGE_SCRIPT_DIRECTORY="${MANAGE_REPOSITORY}/${MANAGE_SCRIPT_DIRECTORY}" - MANAGE_MODULE_DIRECTORY="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" --defaultValue null directories.modules)" + MANAGE_MODULE_DIRECTORY="$(yq '.directories.modules // "null"' "${MANAGE_REPOSITORY}/.manage.yml")" if [[ "${MANAGE_MODULE_DIRECTORY}" == "null" ]] then @@ -19,14 +19,14 @@ parseYAML () { if [[ -z "${MANAGE_PUBLIC}" ]] then local public - public="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" --defaultValue '- help' enable | cut -c3-)" + public="$(yq '.enable // "- help"' "${MANAGE_REPOSITORY}/.manage.yml" | cut -c3-)" MANAGE_PUBLIC=(${public}) fi if includes MANAGE_PUBLIC "test" then - MANAGE_TEST_DIRECTORY="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" --defaultValue null directories.tests)" + MANAGE_TEST_DIRECTORY="$(yq '.directories.tests // "null"' "${MANAGE_REPOSITORY}/.manage.yml")" if [[ "${MANAGE_TEST_DIRECTORY}" == "null" ]] then diff --git a/modules/manage/run b/modules/manage/run index 20d7994..447348c 100644 --- a/modules/manage/run +++ b/modules/manage/run @@ -37,7 +37,7 @@ run () { shift executeScript "${name}" "$@" else - name="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" --defaultValue help default)" + name="$(yq '.default // "help"' "${MANAGE_REPOSITORY}/.manage.yml" )" # if [[ "${MANAGE_SCRIPT_DIRECTORY}" == "null" ]] # then @@ -66,7 +66,7 @@ scriptEnvironment () local delimiter=": " local rx="s/^\([\"']\)\(.*\)\1\$/\2/g" - variables="$(yq r "${MANAGE_REPOSITORY}/.manage.yml" --defaultValue null env)" + variables="$(yq '.env // "null"' "${MANAGE_REPOSITORY}/.manage.yml")" if [[ "${variables}" != "null" ]] then @@ -135,7 +135,7 @@ executeScript () { commandstring="${exports} && ${libexec}" commandstring="${commandstring//$'\n'/ }" - + exec -a "${zero}" \ "bash" \ "--norc" \