Created
November 14, 2017 23:31
-
-
Save jvanderhoof/3564a59f296a9e17f3ed756ad05af695 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
function finish { | |
echo 'Removing test environment' | |
echo '---' | |
docker-compose down --rmi 'local' --volumes | |
} | |
trap finish EXIT | |
function main() { | |
# Generate reports folders locally | |
mkdir -p spec/reports features/reports | |
startConjur | |
runTests | |
} | |
function startConjur() { | |
echo 'Starting Conjur environment' | |
echo '-----' | |
docker-compose pull conjur postgres | |
docker-compose build --pull tester | |
docker-compose up -d conjur | |
} | |
function runTests() { | |
echo 'waiting for Conjur to come up...' | |
docker-compose run --rm tester ./ci/wait_for_server.sh | |
local api_key=$(docker-compose exec -T conjur rails r "print Credentials['cucumber:user:admin'].api_key") | |
echo 'Running tests' | |
echo '-----' | |
docker-compose run --rm \ | |
-e CONJUR_AUTHN_API_KEY="$api_key" \ | |
tester | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment