github.com/m3db/m3@v1.5.0/scripts/vagrant/single/start_vagrant.sh (about)

     1  #!/bin/bash
     2  
     3  set -xe
     4  
     5  export BOX="ubuntu/xenial64"
     6  PROVIDER=${PROVIDER:-virtualbox}
     7  
     8  if [[ "$PROVIDER" == "google" ]]; then
     9      export BOX="google/gce" 
    10  
    11      if [[ "$GOOGLE_PROJECT_ID" == "" ]]; then 
    12          echo "GOOGLE_PROJECT_ID env var not set"
    13          exit 1
    14      fi
    15      if [[ "$GOOGLE_JSON_KEY_LOCATION" == "" ]]; then 
    16          echo "GOOGLE_JSON_KEY_LOCATION env var not set"
    17          exit 1
    18      fi
    19      if [[ "$USER" == "" ]]; then 
    20          echo "USER env var not set"
    21          exit 1
    22      fi
    23      if [[ "$SSH_KEY" == "" ]]; then 
    24          echo "SSH_KEY env var not set"
    25          exit 1
    26      fi
    27  fi
    28  
    29  # Bring up box
    30  echo "Provision box"
    31  vagrant up --provider $PROVIDER
    32  
    33  # Provision cluster. Single machine ONLY operates on primary.
    34  echo "Provision k8s cluster"
    35  vagrant ssh -c 'MACHINE=primary cd provision && ./setup_kube.sh'
    36  
    37  # Run tunnels
    38  echo "Tunnelling"
    39  echo "Grafana available at http://localhost:3333"
    40  vagrant ssh -c "cd provision && ./run_tunnels.sh" --\
    41      -L 3333:localhost:3000 \
    42      -L 7201:localhost:7201 \
    43      -L 9003:localhost:9003 \
    44      -L 9004:localhost:9004 \