mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-09 10:09:09 +00:00
FIX: Ci
This commit is contained in:
@@ -78,9 +78,11 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [ ${GITHUB_REF} == "refs/heads/main" ]; then
|
if [ ${GITHUB_REF} == "refs/heads/main" ]; then
|
||||||
echo "##[set-output name=result;]$(echo "production")"
|
echo "##[set-output name=result;]$(echo "prd")"
|
||||||
else
|
elif [ ${GITHUB_REF} == "refs/heads/alpha" ]; then
|
||||||
echo "##[set-output name=result;]$(echo ${GITHUB_REF#refs/heads/})"
|
echo "##[set-output name=result;]$(echo "alpha")"
|
||||||
|
elif [ ${GITHUB_REF} == "refs/heads/beta" ]; then
|
||||||
|
echo "##[set-output name=result;]$(echo "stg")"
|
||||||
fi
|
fi
|
||||||
id: extract_environment
|
id: extract_environment
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ jobs:
|
|||||||
- name: Install Docker Compose
|
- name: Install Docker Compose
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install docker-compose --upgrade
|
python3 -m pip install docker-compose --upgrade
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
env:
|
env:
|
||||||
ENV: test
|
ENV: test
|
||||||
@@ -25,6 +26,7 @@ jobs:
|
|||||||
export ENV=test
|
export ENV=test
|
||||||
export IMAGE_TAG=test
|
export IMAGE_TAG=test
|
||||||
docker-compose -f build.docker-compose.yml build --build-arg NPM_TOKEN=${NPM_TOKEN}
|
docker-compose -f build.docker-compose.yml build --build-arg NPM_TOKEN=${NPM_TOKEN}
|
||||||
|
|
||||||
- name: Run Test
|
- name: Run Test
|
||||||
env:
|
env:
|
||||||
ENV: test
|
ENV: test
|
||||||
@@ -34,3 +36,9 @@ jobs:
|
|||||||
export ENV=test
|
export ENV=test
|
||||||
export IMAGE_TAG=test
|
export IMAGE_TAG=test
|
||||||
docker-compose -f build.docker-compose.yml run -e NPM_TOKEN=${NPM_TOKEN} --rm --entrypoint="npm run test" maestro
|
docker-compose -f build.docker-compose.yml run -e NPM_TOKEN=${NPM_TOKEN} --rm --entrypoint="npm run test" maestro
|
||||||
|
|
||||||
|
- name: Remove Docker's Trash
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
docker system prune
|
||||||
|
docker rmi -f $(docker images -aq)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import { HttpExceptionFilter } from 'src/error/http-exception.filter';
|
|||||||
@UseFilters(new HttpExceptionFilter())
|
@UseFilters(new HttpExceptionFilter())
|
||||||
export class LoggerMiddleware implements NestMiddleware {
|
export class LoggerMiddleware implements NestMiddleware {
|
||||||
use = async (request: Request, response: Response, next: NextFunction) => {
|
use = async (request: Request, response: Response, next: NextFunction) => {
|
||||||
|
console.log('Middle', new Date());
|
||||||
const idToken = request.get('Dadosfera-User');
|
const idToken = request.get('Dadosfera-User');
|
||||||
const accessToken = request.get('Authorization');
|
const accessToken = request.get('Authorization');
|
||||||
const privateKey = process.env.JWT_PRIVATE_KEY;
|
const privateKey = process.env.JWT_PRIVATE_KEY;
|
||||||
@@ -27,7 +28,7 @@ export class LoggerMiddleware implements NestMiddleware {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const jwtDecoded: any = decode(idToken);
|
const jwtDecoded: any = decode(idToken);
|
||||||
console.log(jwtDecoded);
|
|
||||||
const permissions = jwtDecoded.user.permissions;
|
const permissions = jwtDecoded.user.permissions;
|
||||||
const clienId = jwtDecoded.user.customerId;
|
const clienId = jwtDecoded.user.customerId;
|
||||||
const userId = jwtDecoded.user.id;
|
const userId = jwtDecoded.user.id;
|
||||||
|
|||||||
Reference in New Issue
Block a user