From fcd0e342696aa2bdcb4b6735244c3eabe6101612 Mon Sep 17 00:00:00 2001 From: Clemens Wolff Date: Tue, 10 Jul 2018 15:41:27 -0400 Subject: [PATCH] Enable Azure integration test on Travis CI Note: the tests are run against the Azurite [1] local emulator for Azure Blob Storage and not against a live service. [1] https://github.com/azure/azurite --- scripts/ci/before_install.sh | 7 +++++++ scripts/ci/install_azurite.sh | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 scripts/ci/install_azurite.sh diff --git a/scripts/ci/before_install.sh b/scripts/ci/before_install.sh index a77c9197a..8be55f10b 100644 --- a/scripts/ci/before_install.sh +++ b/scripts/ci/before_install.sh @@ -17,3 +17,10 @@ ssh-keyscan 0.0.0.0 >> ~/.ssh/known_hosts ssh 0.0.0.0 ls &> /dev/null ssh 127.0.0.1 ls &> /dev/null ssh localhost ls &> /dev/null + +scriptdir="$(dirname $0)" + +if [ -n "$TRAVIS_OS_NAME" ] && [ "$TRAVIS_OS_NAME" != "osx" ]; then + bash "$scriptdir/install_azurite.sh" + source ~/.bashrc +fi diff --git a/scripts/ci/install_azurite.sh b/scripts/ci/install_azurite.sh new file mode 100755 index 000000000..c753d4933 --- /dev/null +++ b/scripts/ci/install_azurite.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# install docker +export DEBIAN_FRONTEND=noninteractive +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - +sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" +sudo apt-get update +sudo apt-get install -y docker-ce + +# run azurite +sudo docker run --restart always -e executable=blob -p 10000:10000 --tmpfs /opt/azurite/folder -d arafato/azurite:2.6.5 + +# save secrets +echo "export AZURE_STORAGE_CONTAINER_NAME='travis-tests'" >> ~/.bashrc +echo "export AZURE_STORAGE_CONNECTION_STRING='DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;'" >> ~/.bashrc