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

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