forked from Soluto/oidc-server-mock
-
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.
* e2e and circleci added * circleci status badge added * fix * indent fix * .. * PR CR changes
- Loading branch information
Showing
81 changed files
with
1,976 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,133 @@ | ||
version: 2.1 | ||
|
||
commands: | ||
build_image: | ||
description: Builds image | ||
parameters: | ||
imageName: | ||
type: string | ||
workingDirectory: | ||
type: string | ||
|
||
steps: | ||
- checkout | ||
- run: | ||
name: Build image | ||
working_directory: << parameters.workingDirectory >> | ||
command: docker build -t soluto/<< parameters.imageName >> --build-arg target=PRODUCTION . | ||
|
||
- run: | ||
name: Save image to fs | ||
working_directory: /tmp | ||
command: | | ||
mkdir -p oidc-server-mock | ||
docker save -o oidc-server-mock/<< parameters.imageName >>.tar soluto/<< parameters.imageName >> | ||
- persist_to_workspace: | ||
root: /tmp/oidc-server-mock | ||
paths: | ||
- << parameters.imageName >>.tar | ||
|
||
push_image: | ||
description: Push image to Docker Hub | ||
parameters: | ||
imageName: | ||
type: string | ||
|
||
steps: | ||
- checkout | ||
|
||
- attach_workspace: | ||
at: /tmp/oidc-server-mock | ||
|
||
- run: | ||
name: Load Docker image | ||
command: docker load < /tmp/oidc-server-mock<< parameters.imageName >>.tar | ||
|
||
|
||
- run: | ||
name: Set tag to env | ||
command: echo 'export IMAGE_TAG=`echo "$CIRCLE_TAG" | cut -d'v' -f 2`' >> $BASH_ENV | ||
|
||
- deploy: | ||
name: Tag and push versioned Docker image | ||
command: | | ||
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD | ||
docker tag soluto/<< parameters.imageName >> soluto/<< parameters.imageName >>:${IMAGE_TAG} | ||
docker push soluto/<< parameters.imageName >>:${IMAGE_TAG} | ||
- deploy: | ||
name: Tag and push latest Docker image | ||
command: | | ||
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD | ||
docker tag soluto/<< parameters.imageName >>:${IMAGE_TAG} soluto/<< parameters.imageName >>:lastest | ||
docker push soluto/<< parameters.imageName >>:latest | ||
jobs: | ||
build_oidc_server_mock: | ||
machine: | ||
image: ubuntu-1604:201903-01 | ||
|
||
steps: | ||
- build_image: | ||
imageName: oidc-server-mock | ||
workingDirectory: ./src | ||
|
||
build_e2e: | ||
machine: | ||
image: ubuntu-1604:201903-01 | ||
|
||
steps: | ||
- build_image: | ||
imageName: e2e | ||
workingDirectory: ./e2e | ||
|
||
run_tests: | ||
machine: | ||
image: ubuntu-1604:201903-01 | ||
|
||
steps: | ||
- checkout | ||
|
||
- attach_workspace: | ||
at: /tmp/oidc-server-mock | ||
|
||
- run: | ||
name: Load docker images from fs | ||
working_directory: /tmp/oidc-server-mock | ||
command: | | ||
docker load < oidc-server-mock.tar | ||
docker load < e2e.tar | ||
- run: | ||
name: Run E2E tests | ||
working_directory: e2e | ||
command: scripts/run_tests.sh | ||
|
||
push_oidc_server_mock: | ||
machine: | ||
image: ubuntu-1604:201903-01 | ||
|
||
steps: | ||
- push_image: | ||
imageName: oidc-server-mock | ||
|
||
workflows: | ||
version: 2 | ||
|
||
build_test_push: | ||
jobs: | ||
- build_oidc_server_mock | ||
- build_e2e | ||
- run_tests: | ||
requires: | ||
- build_oidc_server_mock | ||
- build_e2e | ||
- push_oidc_server_mock: | ||
requires: | ||
- run_tests | ||
filters: | ||
branches: | ||
only: master | ||
tags: | ||
only: /^v([0-9]+\.){2}[0-9]+(-\S+)?$/ |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
Dockerfile |
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,83 @@ | ||
dist | ||
.DS_Store | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ |
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,7 @@ | ||
FROM node:10-alpine | ||
|
||
COPY package.json yarn.lock ./ | ||
RUN yarn | ||
COPY ./tests ./tests | ||
|
||
CMD yarn test |
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,25 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: e2e | ||
labels: | ||
name: e2e | ||
app: e2e | ||
spec: | ||
template: | ||
spec: | ||
restartPolicy: Never | ||
containers: | ||
- name: e2e | ||
image: soluto/e2e | ||
imagePullPolicy: Never | ||
env: | ||
- name: OIDC_TOKEN_URL | ||
value: http://oidc-server-mock/connect/token | ||
- name: CLIENT_CREDENTIALS_CLIENT_ID | ||
value: e2e-client-id | ||
- name: CLIENT_CREDENTIALS_CLIENT_SECRET | ||
value: e2e-client-secret | ||
- name: API_RESOURCE | ||
value: user-service-scope | ||
backoffLimit: 0 |
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,57 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: oidc-server-mock | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: oidc-server-mock | ||
template: | ||
metadata: | ||
labels: | ||
app: oidc-server-mock | ||
spec: | ||
containers: | ||
- name: oidc-server-mock | ||
image: soluto/oidc-server-mock | ||
imagePullPolicy: Never | ||
env: | ||
- name: API_RESOURCES_INLINE | ||
value: | | ||
[ | ||
"user-service-scope" | ||
] | ||
- name: CLIENTS_CONFIGURATION_INLINE | ||
value: | | ||
[ | ||
{ | ||
"ClientId": "e2e-client-id", | ||
"ClientSecrets": [ | ||
"e2e-client-secret" | ||
], | ||
"Description": "e2e configuration", | ||
"AllowedGrantTypes": [ | ||
"client_credentials" | ||
], | ||
"AllowedScopes": [ | ||
"user-service-scope" | ||
] | ||
} | ||
] | ||
livenessProbe: | ||
httpGet: | ||
path: /.well-known/openid-configuration | ||
port: 80 | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: oidc-server-mock | ||
spec: | ||
selector: | ||
app: oidc-server-mock | ||
ports: | ||
- name: http | ||
port: 80 | ||
targetPort: 80 | ||
--- |
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,23 @@ | ||
{ | ||
"name": "e2e", | ||
"version": "1.0.0", | ||
"scripts": { | ||
"test": "mocha --require ts-node/register ./**/*.spec.ts --exit" | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"axios": "0.19.0", | ||
"chai": "4.2.0", | ||
"querystring": "0.2.0", | ||
"wait-on": "3.3.0" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "4.1.7", | ||
"@types/mocha": "5.2.7", | ||
"@types/node": "12.6.8", | ||
"mocha": "6.2.0", | ||
"ts-node": "8.3.0", | ||
"tslint": "5.18.0", | ||
"typescript": "3.5.3" | ||
} | ||
} |
Oops, something went wrong.