-
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.
Merge pull request #108 from WildCodeSchool/develop
Develop
- Loading branch information
Showing
123 changed files
with
26,105 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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 @@ | ||
JWT_SECRET_KEY=mykey | ||
FRONTEND_URL=myfrontendurl |
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,32 @@ | ||
name: jest-and-docker-ci | ||
|
||
on: push | ||
|
||
jobs: | ||
test-front: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: Goto frontend and run tests | ||
run: cd frontend && npm i && npm test | ||
|
||
test-back: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: Copy production env file | ||
run: echo "${{ secrets.PRODUCTION_ENV_FILE }}" > .env | ||
- name: Goto backend and run tests | ||
run: cd backend && npm i && npm test | ||
|
||
test-e2e: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
- name: Copy production env file | ||
run: echo "${{ secrets.PRODUCTION_ENV_FILE }}" > .env | ||
- name: Goto e2e and run tests | ||
run: docker compose -f docker-compose.e2e.yml up --build --exit-code-from e2e |
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,44 @@ | ||
# .github/workflows/staging-server.yml | ||
name: Compile and push client image | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the master branch | ||
push: | ||
branches: ["develop"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
# login with Docker | ||
- uses: docker/login-action@v1 | ||
name: Login to Docker Hub | ||
with: | ||
# generate some credentials from Dockerhub and store them into the repo secrets | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
# prepare buildx for docker | ||
- uses: docker/setup-buildx-action@v1 | ||
name: Set up Docker Buildx | ||
|
||
# build an push the newly created image | ||
- uses: docker/build-push-action@v2 | ||
name: Build and push client | ||
with: | ||
context: ./frontend | ||
file: ./frontend/Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_HUB_CLIENT_IMAGE_NAME }}:latest |
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,44 @@ | ||
# .github/workflows/staging-server.yml | ||
name: Compile and push files image | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the master branch | ||
push: | ||
branches: [ "develop" ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
# login with Docker | ||
- uses: docker/login-action@v1 | ||
name: Login to Docker Hub | ||
with: | ||
# generate some credentials from Dockerhub and store them into the repo secrets | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
# prepare buildx for docker | ||
- uses: docker/setup-buildx-action@v1 | ||
name: Set up Docker Buildx | ||
|
||
# build an push the newly created image | ||
- uses: docker/build-push-action@v2 | ||
name: Build and push client | ||
with: | ||
context: ./files | ||
file: ./files/Dockerfile.prod | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_HUB_FILES_IMAGE_NAME }}:latest |
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,44 @@ | ||
# .github/workflows/staging-server.yml | ||
name: Compile and push server image | ||
|
||
# Controls when the workflow will run ! | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the master branch | ||
push: | ||
branches: ["develop"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
# login with Docker | ||
- uses: docker/login-action@v1 | ||
name: Login to Docker Hub | ||
with: | ||
# generate some credentials from Dockerhub and store them into the repo secrets | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
# prepare buildx for docker | ||
- uses: docker/setup-buildx-action@v1 | ||
name: Set up Docker Buildx | ||
|
||
# build an push the newly created image | ||
- uses: docker/build-push-action@v2 | ||
name: Build and push server | ||
with: | ||
context: ./backend | ||
file: ./backend/Dockerfile.prod | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKER_HUB_SERVER_IMAGE_NAME }}:latest |
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,9 @@ | ||
postgres-data/ | ||
/files/src/.env | ||
/files/node_modules/ | ||
/node_modules/ | ||
node_modules/ | ||
.idea/ | ||
.DS_Store | ||
.env | ||
/frontend/package-lock.json |
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 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
/.env |
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,15 @@ | ||
FROM node:lts-alpine3.18 | ||
|
||
WORKDIR /app | ||
|
||
RUN apk --no-cache add curl | ||
|
||
COPY package.json package.json | ||
RUN npm install loglevel --verbose | ||
|
||
COPY tsconfig.json tsconfig.json | ||
|
||
COPY src src | ||
COPY migrations migrations | ||
|
||
CMD npm start |
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,27 @@ | ||
FROM node:lts-alpine as builder | ||
|
||
WORKDIR /app | ||
|
||
COPY tsconfig.json tsconfig.json | ||
COPY package.json package.json | ||
|
||
RUN npm install | ||
RUN npm install -g typescript | ||
|
||
COPY src src | ||
|
||
RUN tsc | ||
|
||
FROM node:lts-alpine | ||
|
||
RUN apk --no-cache add curl | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/dist /app/dist | ||
|
||
COPY package.json package.json | ||
|
||
RUN npm install --production | ||
|
||
CMD npm run startprod |
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 @@ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
moduleNameMapper: { | ||
'^src/(.*)$': '<rootDir>/src/$1', | ||
}, | ||
}; |
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,13 @@ | ||
/* | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
export class CreateMigrationTest1738003402115 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
} | ||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
} | ||
} | ||
*/ |
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,14 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
||
export class TestGenerateMigration1738006098202 implements MigrationInterface { | ||
name = 'TestGenerateMigration1738006098202' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "billing" ADD "test" character varying`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "billing" DROP COLUMN "test"`); | ||
} | ||
|
||
} |
Oops, something went wrong.