Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.