github.com/greenboxal/deis@v1.12.1/tests/bin/test-latest.sh (about)

     1  #!/usr/bin/env bash
     2  #
     3  # Preps a test environment and runs `make test-integration`
     4  # using the latest published artifacts available on Docker Hub
     5  # and the deis.io website.
     6  #
     7  # Usage: ./test-latest.sh [COREOS_CHANNEL]
     8  #
     9  
    10  # fail on any command exiting non-zero
    11  set -eo pipefail
    12  
    13  export COREOS_CHANNEL=${1:-stable}
    14  
    15  # absolute path to current directory
    16  export THIS_DIR=$(cd $(dirname $0); pwd)
    17  
    18  # setup the test environment
    19  source $THIS_DIR/test-setup.sh
    20  
    21  # setup callbacks on process exit and error
    22  trap cleanup EXIT
    23  trap dump_logs ERR
    24  
    25  log_phase "Running test-latest on $DEIS_TEST_APP"
    26  
    27  log_phase "Installing clients"
    28  
    29  # install deis CLI from http://deis.io/ website
    30  pushd $DEIS_ROOT/client
    31  curl -sSL http://deis.io/deis-cli/install.sh | sh
    32  popd
    33  
    34  # install deisctl from http://deis.io/ website
    35  # installs latest unit files to $HOME/.deis/units
    36  pushd $DEIS_ROOT/deisctl
    37  curl -sSL http://deis.io/deisctl/install.sh | sh
    38  popd
    39  
    40  # ensure we use distributed unit files
    41  unset DEISCTL_UNITS
    42  
    43  # use the built client binaries
    44  export PATH=$DEIS_ROOT/deisctl:$DEIS_ROOT/client:$PATH
    45  
    46  log_phase "Provisioning 3-node CoreOS"
    47  
    48  export DEIS_NUM_INSTANCES=3
    49  make discovery-url
    50  vagrant up --provider virtualbox
    51  
    52  log_phase "Waiting for etcd/fleet"
    53  
    54  until deisctl list >/dev/null 2>&1; do
    55      sleep 1
    56  done
    57  
    58  log_phase "Provisioning Deis"
    59  
    60  # configure platform settings
    61  deisctl config platform set domain=$DEIS_TEST_DOMAIN
    62  deisctl config platform set sshPrivateKey=$DEIS_TEST_SSH_KEY
    63  
    64  # provision deis from master using :latest
    65  time deisctl install platform
    66  time deisctl start platform
    67  
    68  log_phase "Running integration tests"
    69  
    70  # run the smoke tests unless another target is specified
    71  make ${TEST_TYPE:-test-smoke}