From 3ec2d79cb1bc8decbec7affc7e1d0f56da0512c6 Mon Sep 17 00:00:00 2001 From: Dennis ten Hoove Date: Sun, 12 Nov 2023 23:03:29 +0000 Subject: [PATCH] Allow - to define default target --- README.md | 10 +++++++--- arkdep | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index adda006..2c9cc8f 100644 --- a/README.md +++ b/README.md @@ -47,13 +47,17 @@ It will check in with the server defined in `/arkdep/config` as `repo_url` and p ### Deploying a specified image version A specific image version to pull and deploy can be parsed like so; ```shell -sudo arkdep deploy 00ce35074659538f946be77d9efaefc37725335689 +sudo arkdep deploy arkanelinux 00ce35074659538f946be77d9efaefc37725335689 +``` + +The target name may be substituted with a `-` to pull the default target. +```shell +sudo arkdep deploy - 00ce35074659538f946be77d9efaefc37725335689 ``` -Simply provide the basename of the image and it will attempt to find it in `/database`. You do not have to provide the full basename, you can provide it with an impartial basename, the first hit will be pulled and deployed. ```shell -sudo arkdep deploy 00ce +sudo arkdep deploy arkanelinux 00ce ``` ## Packaging diff --git a/arkdep b/arkdep index b63c0b0..72a56f5 100755 --- a/arkdep +++ b/arkdep @@ -266,7 +266,7 @@ deploy () { # target and version are optional, if not defined default to primary as defined in # /arkdep/config and latest - if [[ -n $2 ]]; then + if [[ -n $2 ]] && [[ $2 != '-' ]]; then declare -r deploy_target=$2 else declare -r deploy_target="$repo_default_image" @@ -297,7 +297,7 @@ deploy () { # Lets ensure the requested image is not already deployed if [[ -e $arkdep_dir/deployments/${data[0]} ]]; then printf "\e[1;33m\e[0m\e[1m ${data[0]} is already deployed, canceling deployment\e[0m\n" - exit 0 + exit 1 fi # Check if requested version is already downloaded