update the committers for icn
[icn.git] / deploy / site / vm / vm.sh
1 #!/usr/bin/env bash
2 set -eux -o pipefail
3
4 SCRIPTDIR="$(readlink -f $(dirname ${BASH_SOURCE[0]}))"
5 LIBDIR="$(dirname $(dirname $(dirname ${SCRIPTDIR})))/env/lib"
6
7 source $LIBDIR/common.sh
8 source $SCRIPTDIR/../common.sh
9
10 BUILDDIR=${SCRIPTDIR/deploy/build}
11 mkdir -p ${BUILDDIR}
12
13 SITE_REPO=${SITE_REPO:-"https://gerrit.akraino.org/r/icn"}
14 SITE_BRANCH=${SITE_BRANCH:-"master"}
15 SITE_PATH=${SITE_PATH:-"deploy/site/vm/deployment"}
16
17 case $1 in
18     "clean") site_clean ;;
19     "deploy")
20         gpg --import ${FLUX_SOPS_PRIVATE_KEY}
21         site_deploy ;;
22     "wait")
23         site_wait_for_all_ready
24         site_insert_control_plane_network_identity_into_ssh_config
25         ;;
26     "wait-clean") site_wait_for_all_deleted ;;
27     *) cat <<EOF
28 Usage: $(basename $0) COMMAND
29
30 Commands:
31   clean         - Remove the site
32   deploy        - Deploy the site
33   wait          - Wait for the site to be ready
34   wait-clean    - Wait for the site to be removed
35 EOF
36        ;;
37 esac