forked from auth0-samples/auth0-aspnetcore-mvc-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
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
3925613
commit 6fc5f87
Showing
5 changed files
with
99 additions
and
7 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,90 @@ | ||
# 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: | | ||
docker build -t $CIRCLE_JOB ./$SAMPLE_PATH | ||
docker run -d -p 3000:3000 --name $CIRCLE_SHA1 -e "ASPNETCORE_URLS=http://*:3000" $CIRCLE_JOB | ||
background: true | ||
- run: | ||
name: Wait for app to be available | ||
command: | | ||
sleep 70 | ||
docker run --network host --rm appropriate/curl --retry 8 --retry-connrefused -v localhost:3000 | ||
- 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-dotnetcore https://github.com/alexisluque/spa-quickstarts-tests scripts | ||
- persist_to_workspace: | ||
root: ~/ | ||
paths: | ||
- project | ||
- scripts | ||
01-login: | ||
machine: true | ||
environment: | ||
- AUTH0_CFG: Quickstart/01-Login/SampleMvcApp/appsettings.json | ||
- SAMPLE_PATH: Quickstart/01-Login | ||
<<: *defaults | ||
02-user-profile: | ||
machine: true | ||
environment: | ||
- AUTH0_CFG: Quickstart/02-User-Profile/SampleMvcApp/appsettings.json | ||
- SAMPLE_PATH: Quickstart/01-Login | ||
<<: *defaults | ||
03-authorization: | ||
machine: true | ||
environment: | ||
- AUTH0_CFG: Quickstart/03-Authorization/SampleMvcApp/appsettings.json | ||
- SAMPLE_PATH: Quickstart/03-Authorization | ||
<<: *defaults | ||
|
||
workflows: | ||
version: 2 | ||
quickstarts_login: | ||
jobs: | ||
- checkout: | ||
context: Quickstart Web App Test | ||
- 01-login: | ||
context: Quickstart Web App Test | ||
requires: | ||
- checkout | ||
- 02-user-profile: | ||
context: Quickstart Web App Test | ||
requires: | ||
- checkout | ||
- 03-authorization: | ||
context: Quickstart Web App Test | ||
requires: | ||
- checkout |
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
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
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
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Auth0 ASP.NET Core MVC Samples | ||
|
||
[![CircleCI](https://circleci.com/gh/auth0-samples/auth0-aspnetcore-mvc-samples.svg?style=svg)](https://circleci.com/gh/auth0-samples/auth0-aspnetcore-mvc-samples) | ||
|
||
This repository contains all the samples for the [Auth0 ASP.NET Core MVC Quickstart](https://auth0.com/docs/quickstart/webapp/aspnet-core), as well as other samples demonstrating some specific use cases. | ||
|
||
Please refer to the README files in the individual folders for more information. | ||
Please refer to the README files in the individual folders for more information. |