Allow - to define default target

This commit is contained in:
Dennis ten Hoove 2023-11-12 23:03:29 +00:00
parent f2fbe8f1f5
commit 3ec2d79cb1
2 changed files with 9 additions and 5 deletions

View file

@ -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

4
arkdep
View file

@ -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