This repository has been archived by the owner on Jul 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9f4afd
commit 33ecd7a
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Common logic | ||
defaults: &defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/ | ||
- run: | ||
name: Replace Auth0 test credentials | ||
command: | | ||
sed -i 's/{CLIENT_ID}/'$AUTH0_TEST_CLIENT_ID'/g' $AUTH0_CFG | ||
sed -i 's/{DOMAIN}/'$AUTH0_TEST_DOMAIN'/g' $AUTH0_CFG | ||
sed -i 's/{CLIENT_SECRET}/'$AUTH0_TEST_CLIENT_SECRET'/g' $AUTH0_CFG | ||
- run: | ||
name: Build pull request | ||
command: | | ||
cd $SAMPLE_PATH/ | ||
sh exec.sh | ||
background: true | ||
- run: | ||
name: Wait for app to be available | ||
command: | | ||
sleep 80 | ||
docker run --network host --rm appropriate/curl --retry 8 --retry-connrefused -v localhost:3000/portal/home | ||
- run: | ||
name: Run tests | ||
command: | | ||
docker create --network host --name tester codeception/codeceptjs codeceptjs run-multiple --all --steps | ||
docker cp $(pwd)/lock_login_test.js tester:/tests/lock_login_test.js | ||
docker cp $(pwd)/codecept.conf.js tester:/tests/codecept.conf.js | ||
docker start -i tester | ||
working_directory: scripts | ||
- run: | ||
name: Copy app container logs | ||
command: | | ||
mkdir -p /tmp/out | ||
docker logs $CIRCLE_SHA1 > /tmp/out/app_logs.log | ||
docker cp tester:/tests/out /tmp/ | ||
when: on_fail | ||
- store_artifacts: | ||
path: /tmp/out | ||
|
||
# Jobs and Workflows | ||
version: 2 | ||
jobs: | ||
checkout: | ||
machine: true | ||
steps: | ||
- checkout | ||
- run: git clone -b refactor-for-java https://github.com/alexisluque/spa-quickstarts-tests scripts | ||
- persist_to_workspace: | ||
root: ~/ | ||
paths: | ||
- project | ||
- scripts | ||
01-login: | ||
machine: true | ||
environment: | ||
- AUTH0_CFG: 01-Login/src/main/resources/auth0.properties | ||
- SAMPLE_PATH: 01-Login | ||
<<: *defaults | ||
|
||
workflows: | ||
version: 2 | ||
quickstarts_login: | ||
jobs: | ||
- checkout: | ||
context: Quickstart Web App Test | ||
- 01-login: | ||
context: Quickstart Web App Test | ||
requires: | ||
- checkout |