1- version : 2
2- jobs :
3- build :
4- working_directory : ~/repo/00-Starter-Seed
5- machine : true
6-
1+ defaults : &defaults
72 steps :
8- - checkout :
9- path : ~/repo
10-
11- - run :
12- name : Set .env file
3+ - attach_workspace :
4+ at : ~/
5+ - run :
6+ name : Replace Auth0 test credentials
137 command : |
14- echo "AUTH0_DOMAIN=$auth0_domain" >> .env
15- echo "API_IDENTIFIER=$api_identifier" >> .env
16-
17- - run :
18- name : background server
19- command : sh exec.sh
20- background : true
21-
8+ cd $AUTH0_CFG
9+ mv .env.example .env
10+ sed -i 's/{CLIENT_ID}/'$client_id_scopes_none'/g' .env
11+ sed -i 's/{CLIENT_SECRET}/'$client_secret_scopes_none'/g' .env
12+ sed -i 's/{DOMAIN}/'$auth0_domain'/g' .env
13+ sed -i 's/{API_IDENTIFIER}/'$api_identifier'/g' .env
14+ head .env
2215 - run :
23- name : Wait until server is online
24- command : |
25- until $(curl --output /dev/null --silent --head --fail http://localhost:3010/api/public); do
26- sleep 5
27- done
28-
16+ name : Background Server
17+ command : cd $AUTH0_CFG && sh exec.sh
18+ background : true
2919 - run :
30- name : Clone script test
31- command : git clone https://github.com/auth0-samples/api-quickstarts-tests test
32-
33- - run :
34- name : Prepare environment variables for test
20+ name : Wait until server is online
21+ command : |
22+ until $(curl --output /dev/null --fail http://localhost:3010/api/public); do
23+ sleep 5
24+ done
25+ - run :
26+ name : Prepare tests
3527 command : |
3628 cd test
3729 echo "AUTH0_DOMAIN=$auth0_domain" >> .env
@@ -45,17 +37,38 @@ jobs:
4537 echo "AUTH0_CLIENT_ID_4=$client_id_scopes_readwrite" >> .env
4638 echo "AUTH0_CLIENT_SECRET_4=$client_secret_scopes_readwrite" >> .env
4739 echo "API_URL=http://localhost:3010" >> .env
48-
49- - run :
50- name : Install test script dependency
51- command : cd test && npm install
52-
40+ npm install
41+ head .env
5342 - run :
54- name : Test
55- command : cd test && npm test
43+ name : Execute automated tests
44+ command : cd test && npm test
45+ # Jobs and Workflows
46+ version : 2
47+ jobs :
48+ checkout :
49+ machine : true
50+ steps :
51+ - checkout
52+ - run : git clone https://github.com/auth0-samples/api-quickstarts-tests test
53+ - persist_to_workspace :
54+ root : ~/
55+ paths :
56+ - project
57+ - test
58+ 00-Starter-Seed :
59+ machine : true
60+ environment :
61+ - AUTH0_CFG : 00-Starter-Seed
62+ - SAMPLE_PATH : 00-Starter-Seed
63+ << : *defaults
64+
5665workflows :
5766 version : 2
58- build :
67+ API-Tests :
5968 jobs :
60- - build :
69+ - checkout :
70+ context : Quickstart API Tests
71+ - 00-Starter-Seed :
6172 context : Quickstart API Tests
73+ requires :
74+ - checkout
0 commit comments