Skip to content

Commit 3bff3d2

Browse files
committed
Add circleCI support
1 parent 89ac51c commit 3bff3d2

File tree

4 files changed

+76
-3
lines changed

4 files changed

+76
-3
lines changed

.circleci/config.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Common logic
2+
defaults: &defaults
3+
steps:
4+
- attach_workspace:
5+
at: ~/
6+
- run:
7+
name: Replace Auth0 test credentials
8+
command: |
9+
mv $AUTH0_CFG.example $AUTH0_CFG
10+
sed -i 's/{CLIENT_ID}/'$AUTH0_TEST_CLIENT_ID'/g' $AUTH0_CFG
11+
sed -i 's/{DOMAIN}/'$AUTH0_TEST_DOMAIN'/g' $AUTH0_CFG
12+
sed -i 's/{CLIENT_SECRET}/'$AUTH0_TEST_CLIENT_SECRET'/g' $AUTH0_CFG
13+
- run:
14+
name: Build pull request
15+
command: |
16+
docker build -t $CIRCLE_JOB ./$SAMPLE_PATH
17+
docker run -d -p 3000:3000 --name $CIRCLE_SHA1 --env-file ./$AUTH0_CFG $CIRCLE_JOB
18+
background: true
19+
- run:
20+
name: Wait for app to be available
21+
command: |
22+
sleep 20
23+
docker run --network host --rm appropriate/curl --retry 8 --retry-connrefused -v localhost:3000
24+
- run:
25+
name: Run tests
26+
command: |
27+
docker create --network host --name tester codeception/codeceptjs codeceptjs run-multiple --all --steps
28+
docker cp $(pwd)/lock_login_test.js tester:/tests/lock_login_test.js
29+
docker cp $(pwd)/codecept.conf.js tester:/tests/codecept.conf.js
30+
docker start -i tester
31+
working_directory: scripts
32+
- run:
33+
name: Copy app container logs
34+
command: |
35+
mkdir -p /tmp/out
36+
docker logs $CIRCLE_SHA1 > /tmp/out/app_logs.log
37+
docker cp tester:/tests/out /tmp/
38+
when: on_fail
39+
- store_artifacts:
40+
path: /tmp/out
41+
42+
# Jobs and Workflows
43+
version: 2
44+
jobs:
45+
checkout:
46+
machine: true
47+
steps:
48+
- checkout
49+
- run: git clone https://github.com/auth0-samples/spa-quickstarts-tests scripts
50+
- persist_to_workspace:
51+
root: ~/
52+
paths:
53+
- project
54+
- scripts
55+
01-login:
56+
machine: true
57+
environment:
58+
- AUTH0_CFG: 01-Login/.env
59+
- SAMPLE_PATH: 01-Login
60+
<<: *defaults
61+
62+
workflows:
63+
version: 2
64+
quickstarts_login:
65+
jobs:
66+
- checkout:
67+
context: Quickstart Web App Test
68+
- 01-login:
69+
context: Quickstart Web App Test
70+
requires:
71+
- checkout

01-Login/templates/dashboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h1 id="logo"><img src="//cdn.auth0.com/samples/auth0_logo_final_blue_RGB.png" /
1515
<img class="avatar" src="{{userinfo['picture']}}"/>
1616
<h2>Welcome {{userinfo['name']}}</h2>
1717
<pre>{{userinfo_pretty}}</pre>
18-
<a class="btn btn-primary btn-lg btn-logout btn-block" href="/logout">Logout</a>
18+
<a id="qsLogoutBtn" class="btn btn-primary btn-lg btn-logout btn-block" href="/logout">Logout</a>
1919
</div>
2020
</div>
2121
</div>

01-Login/templates/home.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<img src="https://i.cloudup.com/StzWWrY34s.png" />
1717
<h3>Auth0 Example</h3>
1818
<p>Zero friction identity infrastructure, built for developers</p>
19-
<a class="btn btn-primary btn-lg btn-login btn-block" href="/login">Log In</a>
19+
<a id="qsLoginBtn" class="btn btn-primary btn-lg btn-login btn-block" href="/login">Log In</a>
2020
</div>
2121
</div>
2222
</div>

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Auth0 Python Web App
22

3+
[![CircleCI](https://circleci.com/gh/auth0-samples/auth0-python-web-app.svg?style=svg)](https://circleci.com/gh/auth0-samples/auth0-python-web-app)
4+
35
This sample demonstrates how to add authentication to a Python web app using Auth0.
46

57
## What is Auth0?
@@ -24,7 +26,7 @@ If you have found a bug or if you have a feature request, please report them at
2426

2527
## Author
2628

27-
[Auth0](auth0.com)
29+
[Auth0](https://auth0.com)
2830

2931
## License
3032

0 commit comments

Comments
 (0)