github.com/m3db/m3@v1.5.0/scripts/vagrant/shared/ssh_vagrant.sh (about) 1 #!/bin/bash 2 3 set -xe 4 5 export BOX="ubuntu/xenial64" 6 PROVIDER=${PROVIDER:-virtualbox} 7 8 if [[ "$PROVIDER" != "virtualbox" ]]; then 9 if [[ "$USER" == "" ]]; then 10 echo "USER env var not set" 11 exit 1 12 fi 13 if [[ "$SSH_KEY" == "" ]]; then 14 echo "SSH_KEY env var not set" 15 exit 1 16 fi 17 fi 18 19 if [[ "$PROVIDER" == "google" ]]; then 20 export BOX="google/gce" 21 22 if [[ "$GOOGLE_PROJECT_ID" == "" ]]; then 23 echo "GOOGLE_PROJECT_ID env var not set" 24 exit 1 25 fi 26 if [[ "$GOOGLE_JSON_KEY_LOCATION" == "" ]]; then 27 echo "GOOGLE_JSON_KEY_LOCATION env var not set" 28 exit 1 29 fi 30 if [[ "$USER" == "" ]]; then 31 echo "USER env var not set" 32 exit 1 33 fi 34 if [[ "$MACHINE" == "" ]]; then 35 echo "MACHINE env var not set" 36 exit 1 37 fi 38 if [[ "$SSH_KEY" == "" ]]; then 39 echo "SSH_KEY env var not set" 40 exit 1 41 fi 42 fi 43 44 if [[ "$PROVIDER" == "azure" ]]; then 45 export BOX="azure" 46 47 if [[ "$AZURE_TENANT_ID" == "" ]]; then 48 echo "AZURE_TENANT_ID env var not set" 49 exit 1 50 fi 51 if [[ "$AZURE_CLIENT_ID" == "" ]]; then 52 echo "AZURE_CLIENT_ID env var not set" 53 exit 1 54 fi 55 if [[ "$AZURE_CLIENT_SECRET" == "" ]]; then 56 echo "AZURE_CLIENT_SECRET env var not set" 57 exit 1 58 fi 59 if [[ "$AZURE_SUBSCRIPTION_ID" == "" ]]; then 60 echo "AZURE_SUBSCRIPTION_ID env var not set" 61 exit 1 62 fi 63 fi 64 65 vagrant ssh $MACHINE