diff --git a/devops.sh b/devops.sh index 19c3ddc..99531c2 100644 --- a/devops.sh +++ b/devops.sh @@ -6,6 +6,7 @@ PROVIDER=0 ERROR=0 CONFIGDIR=$(pwd) BINARYDIR=$(pwd) +STOPONLY=0 while [ $# -gt 0 ]; do case "$1" in @@ -25,6 +26,10 @@ while [ $# -gt 0 ]; do --binarydir) BINARYDIR="$2" shift + ;; + --stoponly) + STOPONLY=1 + shift ;; *) echo "Illegal option $1" @@ -47,6 +52,7 @@ Available options: --provider update provider --configdir config directory --binarydir binary directory + --stoponly stop service EOF exit 1 } @@ -76,6 +82,10 @@ main () { stopRemoteService "providernet" stopRemoteService "sentrynet" + if [ $STOPONLY = 1 ]; then + exit 0 + fi + echo "upload binary files" ansible-playbook -i testnet/remote/ansible/inventory/digital_ocean.py -l sentrynet testnet/remote/ansible/config.yml -e CONFIGDIR=$CONFIGDIR -e BINARY=$BINARYDIR/katzenmint if [ $? -ne 0 ]; then @@ -90,6 +100,10 @@ main () { stopRemoteService "mixnet" fi + if [ $STOPONLY = 1 ]; then + exit 0 + fi + echo "upload binary files" ansible-playbook -i testnet/remote/ansible/inventory/digital_ocean.py -l mixnet testnet/remote/ansible/config.yml -e CONFIGDIR=$CONFIGDIR -e BINARY=$BINARYDIR/meson-server if [ $? -ne 0 ]; then @@ -104,6 +118,10 @@ main () { stopRemoteService "providernet" fi + if [ $STOPONLY = 1 ]; then + exit 0 + fi + echo "upload binary files" ansible-playbook -i testnet/remote/ansible/inventory/digital_ocean.py -l providernet testnet/remote/ansible/config.yml -e CONFIGDIR=$CONFIGDIR -e BINARY=$BINARYDIR if [ $? -ne 0 ]; then diff --git a/docs/docs/docs.md b/docs/docs/docs.md index 487fcaf..7e1ba5f 100644 --- a/docs/docs/docs.md +++ b/docs/docs/docs.md @@ -58,21 +58,21 @@ https://docs.digitalocean.com/products/droplets/how-to/add-ssh-keys/ ##### Meson mix services * create droplets on Digital Ocean - * go to `docker/remote/terraform` + * go to `testnetremote/terraform` * apply terraform config`terraform apply -var DO_API_TOKEN="$DO_API_TOKEN" -var SSH_KEY_FILE="$SSH_KEY_FILE"` * remove droplets on Digital Ocean - * go to `docker/remote/terraform` + * go to `testnetremote/terraform` * `terraform destroy -var DO_API_TOKEN="$DO_API_TOKEN" -var SSH_KEY_FILE="$SSH_KEY_FILE"` > if you want to remove specific droplet, added -target: -target="module.cluster.digitalocean_droplet.cluster[3]" * katzenmint-pki - * go to `docker/remote/ansible` + * go to `testnetremote/ansible` * install the service `ansible-playbook -i inventory/digital_ocean.py -l sentrynet install.yml` * upload config and binary `ansible-playbook -i inventory/digital_ocean.py -l sentrynet config.yml -e CONFIGDIR=/path/to/config/directory -e BINARY=/path/to/binary` * mix - * go to `docker/remote/ansible` + * go to `testnetremote/ansible` * install the service `ansible-playbook -i inventory/digital_ocean.py -l mixnet install.yml` * upload config and binary `ansible-playbook -i inventory/digital_ocean.py -l mixnet config.yml -e CONFIGDIR=/path/to/config/directory -e BINARY=/path/to/binary` * provider - * go to `docker/remote/ansible` + * go to `testnetremote/ansible` * install the service `ansible-playbook -i inventory/digital_ocean.py -l providernet install.yml` * upload config and binary `ansible-playbook -i inventory/digital_ocean.py -l providernet config.yml -e CONFIGDIR=/path/to/config/directory -e BINARYDIR=/path/to/binary/directory`