Skip to content

Commit

Permalink
v3.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
escapace committed Nov 8, 2022
1 parent f00b170 commit 3c4e223
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 8 additions & 6 deletions manage
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}" ] && {
Expand Down Expand Up @@ -887,6 +887,9 @@ MANAGE_ARCH () {
i386)
arch="386"
;;
arm64)
arch="arm64"
;;
aarch64)
arch="arm64"
;;
Expand Down Expand Up @@ -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
Expand All @@ -950,7 +953,6 @@ MANAGE_GET_YQ() {

if [[ "${download}" == "true" ]]
then

{
if [[ "${MANAGE_INTERACTIVE}" == "true" ]]
then
Expand All @@ -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
}

Expand Down
8 changes: 4 additions & 4 deletions modules/manage/parseYAML
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions modules/manage/run
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -135,7 +135,7 @@ executeScript () {

commandstring="${exports} && ${libexec}"
commandstring="${commandstring//$'\n'/ }"

exec -a "${zero}" \
"bash" \
"--norc" \
Expand Down

0 comments on commit 3c4e223

Please sign in to comment.