Skip to content

Commit

Permalink
Publish
Browse files Browse the repository at this point in the history
  • Loading branch information
bot committed Jan 8, 2025
1 parent ed64c5a commit 924a180
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions maps-tools-testing
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#needs to increment on every change!!!
#version: 40
#version: 41
#initialize variables
readonly DEFAULT_DOCKER_IMAGE_REGISTRY="ghcr.io/spring-media"
readonly DEFAULT_DOCKER_IMAGE_NAME=maps-tools
Expand Down Expand Up @@ -181,7 +181,7 @@ function get_script() {

function install_script() {
if [ -f /tmp/maps-tools ]; then
echo "If ask, enter your AD password to install maps-tools into /usr/local/bin/maps-tools"
echo "If asked, enter your AD password to install maps-tools into /usr/local/bin/maps-tools"
cp -f /tmp/maps-tools /usr/local/bin/maps-tools 1>&- 2>&- || sudo cp -f /tmp/maps-tools /usr/local/bin/maps-tools
chmod 755 /usr/local/bin/maps-tools 1>&- 2>&- || sudo chmod 755 /usr/local/bin/maps-tools
else
Expand All @@ -200,8 +200,17 @@ function check_for_updates() {
if [ "$yn" == "y" ]; then
echo "upgrading maps-tools to version ${new_version}"
install_script
docker_pull
if [[ $RELEASE = "testing" ]]; then
docker pull ${DEFAULT_DOCKER_IMAGE}:${DEFAULT_DOCKER_IMAGE_TAG_TESTING}
elif [[ -n $RELEASE ]]; then
RELEASE_CUT=$(echo "$RELEASE" | sed 's/^-//')
echo "pulling docker image ${DEFAULT_DOCKER_IMAGE}:${RELEASE_CUT}"
docker pull ${DEFAULT_DOCKER_IMAGE}:${RELEASE_CUT}
fi
else
echo "Continuing with current version of maps-tools"
fi
echo "no upgrade available for maps-tools"
else
if [[ $RELEASE = "testing" ]]; then
docker pull ${DEFAULT_DOCKER_IMAGE}:${DEFAULT_DOCKER_IMAGE_TAG_TESTING}
Expand All @@ -210,8 +219,8 @@ function check_for_updates() {
echo "pulling docker image ${DEFAULT_DOCKER_IMAGE}:${RELEASE_CUT}"
docker pull ${DEFAULT_DOCKER_IMAGE}:${RELEASE_CUT}
fi
echo "no upgrade available for maps-tools"
fi

else
echo "no version of maps-tools found for installation"
exit 1
Expand All @@ -225,14 +234,6 @@ function cleanup_tmp() {
fi
}

function docker_pull() {
if [[ -z $RELEASE ]]; then
docker pull ${DEFAULT_DOCKER_IMAGE}:$RELEASE
else
docker pull ${DEFAULT_DOCKER_IMAGE}:${DEFAULT_DOCKER_IMAGE_TAG}
fi
}

function getopts_get_optional_argument() {
eval next_token=\${$OPTIND}
if [[ -n $next_token && $next_token != -* ]]; then
Expand Down

0 comments on commit 924a180

Please sign in to comment.