-
-
Save cyeong/0e6844e4dda21e0ba3420b14079e3972 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