-
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
0 parents
commit c87ddee
Showing
232 changed files
with
37,245 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
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,12 @@ | ||
DB_USER=postgres | ||
DB_PASS=postgres | ||
JWT_PRIVATE_KEY=your-jwt-private-key | ||
NODE_ENV="production" | ||
GATEWAY_PORT=8000 | ||
CORS_ALLOWED_ORIGINS=http://localhost:8000 | ||
SMTP_HOST=in-v3.mailjet.com | ||
SMTP_PORT=465 | ||
SMTP_USER=changeme | ||
SMTP_PASS=changeme | ||
[email protected] | ||
FRONTEND_URL=http://localhost:8000 |
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,12 @@ | ||
DB_USER=postgres | ||
DB_PASS=postgres | ||
JWT_PRIVATE_KEY=your-jwt-private-key | ||
NODE_ENV="production" | ||
GATEWAY_PORT=8000 | ||
CORS_ALLOWED_ORIGINS=http://localhost:8000 | ||
SMTP_HOST=in-v3.mailjet.com | ||
SMTP_PORT=465 | ||
SMTP_USER=changeme | ||
SMTP_PASS=changeme | ||
[email protected] | ||
FRONTEND_URL=http://localhost:8000 |
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,36 @@ | ||
name: build and push production server to dockerhub | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
image_name: | ||
type: string | ||
required: true | ||
secrets: | ||
DOCKERHUB_USERNAME: | ||
required: true | ||
DOCKERHUB_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
build-and-push-server: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: true | ||
context: "{{defaultContext}}:backend" | ||
file: "Dockerfile.production" | ||
tags: ${{ inputs.image_name }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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,35 @@ | ||
name: build and push production client to dockerhub | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
image_name: | ||
type: string | ||
required: true | ||
secrets: | ||
DOCKERHUB_USERNAME: | ||
required: true | ||
DOCKERHUB_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
build-and-push-client: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: true | ||
context: "{{defaultContext}}:frontend" | ||
file: "Dockerfile.production" | ||
tags: ${{ inputs.image_name }} | ||
cache-from: type=gha |
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,49 @@ | ||
name: Test, compile and push client and server to production | ||
|
||
on: | ||
push: | ||
branches: ["dev"] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test-client: | ||
uses: WildCodeSchool/2023-11-wns-bleu-g3/.github/workflows/tests-front.yml@dev | ||
|
||
e2e-tests: | ||
uses: WildCodeSchool/2023-11-wns-bleu-g3/.github/workflows/e2e.yml@dev | ||
|
||
integration-tests: | ||
uses: WildCodeSchool/2023-11-wns-bleu-g3/.github/workflows/integration-tests.yml@dev | ||
|
||
build-and-push-server: | ||
needs: | ||
- integration-tests | ||
- e2e-tests | ||
uses: WildCodeSchool/2023-11-wns-bleu-g3/.github/workflows/build-backend.yml@dev | ||
secrets: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
with: | ||
image_name: greenfoot/greenfoot-back-dev | ||
|
||
build-and-push-client: | ||
needs: | ||
- test-client | ||
- e2e-tests | ||
uses: WildCodeSchool/2023-11-wns-bleu-g3/.github/workflows/build-frontend.yml@dev | ||
secrets: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
with: | ||
image_name: greenfoot/greenfoot-front-dev | ||
|
||
notify-vps: | ||
needs: | ||
- build-and-push-client | ||
- build-and-push-server | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Call VPS webhook to update dev | ||
uses: wei/curl@master | ||
with: | ||
args: https://ops.1123-bleu-3.wns.wilders.dev/hooks/update-dev |
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,49 @@ | ||
name: Test, compile and push client and server to production | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test-client: | ||
uses: WildCodeSchool/2023-11-wns-bleu-g3/.github/workflows/tests-front.yml@main | ||
|
||
e2e-tests: | ||
uses: WildCodeSchool/2023-11-wns-bleu-g3/.github/workflows/e2e.yml@main | ||
|
||
integration-tests: | ||
uses: WildCodeSchool/2023-11-wns-bleu-g3/.github/workflows/integration-tests.yml@main | ||
|
||
build-and-push-server: | ||
needs: | ||
- integration-tests | ||
- e2e-tests | ||
uses: WildCodeSchool/2023-11-wns-bleu-g3/.github/workflows/build-backend.yml@main | ||
secrets: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
with: | ||
image_name: greenfoot/greenfoot-back | ||
|
||
build-and-push-client: | ||
needs: | ||
- test-client | ||
- e2e-tests | ||
uses: WildCodeSchool/2023-11-wns-bleu-g3/.github/workflows/build-frontend.yml@main | ||
secrets: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
with: | ||
image_name: greenfoot/greenfoot-front | ||
|
||
notify-vps: | ||
needs: | ||
- build-and-push-client | ||
- build-and-push-server | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Call VPS webhook to update production | ||
uses: wei/curl@master | ||
with: | ||
args: https://ops.1123-bleu-3.wns.wilders.dev/hooks/update-production |
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,56 @@ | ||
name: e2e-tests | ||
|
||
on: | ||
pull_request: | ||
workflow_call: | ||
|
||
jobs: | ||
e2e-tests: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./e2e-tests | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# https://github.com/satackey/action-docker-layer-caching | ||
# - uses: satackey/[email protected] | ||
# # Ignore the failure of a step and avoid terminating the job. | ||
# continue-on-error: true | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: Install Dependencies | ||
run: npm ci | ||
- name: Install backend dependencies | ||
run: cd ../backend && npm ci | ||
# https://github.com/microsoft/playwright/issues/7249#issuecomment-1385567519 | ||
- name: Store Playwright's Version | ||
run: | | ||
PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//') | ||
echo "Playwright's Version: $PLAYWRIGHT_VERSION" | ||
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV | ||
- name: Cache Playwright Browsers for Playwright's Version | ||
id: cache-playwright-browsers | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/ms-playwright | ||
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} | ||
- name: Setup Playwright | ||
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true' | ||
run: npx playwright install --with-deps | ||
- name: Make envfiles | ||
run: | | ||
cp .env.dev .env | ||
cd ../backend/ && cp .env.dev .env | ||
cd ../frontend/ && cp .env.dev .env && cp next-env.d.ts.dev next-env.d.ts | ||
- name: Start app | ||
run: npm run app:start | ||
- name: Run Playwright tests | ||
run: npm run test | ||
- name: Store Artifacts from Failed Tests | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-results | ||
path: e2e-tests/test-results/ | ||
retention-days: 7 |
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 @@ | ||
name: "integration-tests" | ||
|
||
on: | ||
pull_request: | ||
workflow_call: | ||
|
||
jobs: | ||
integration-tests: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./backend | ||
steps: | ||
- name: Get the code | ||
uses: actions/checkout@v4 | ||
- name: Install NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: Make envfile | ||
run: cp .env.dev .env | ||
- name: Install deps | ||
run: npm ci | ||
- name: Start test DB | ||
run: npm run testDB:wait | ||
- name: Run tests | ||
run: npm 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,23 @@ | ||
name: "test-frontend" | ||
|
||
on: | ||
pull_request: | ||
workflow_call: | ||
|
||
jobs: | ||
test-client: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./frontend | ||
steps: | ||
- name: Get the code | ||
uses: actions/checkout@v4 | ||
- name: Install NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: Install deps | ||
run: npm ci | ||
- name: Run tests | ||
run: npm 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,2 @@ | ||
.env.production | ||
.env.dev |
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,11 @@ | ||
# Welcome to GreenFoot - From Les Pattes Carbone | ||
|
||
|
||
|
||
Règles : | ||
|
||
- le nom de la branche doit correspondre à la feature (ex: fix/nomDuFix ou feature/nomDeLaFeature) | ||
- le reviewer gère sa review mais ne merge pas la PR et ne supprime pas la branche | ||
- avant de push, récupérer la dernière version de dev pour éviter les conflits | ||
- merger dev sur main en fin de sprint | ||
- commits explicites |
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 | ||
.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,17 @@ | ||
FROM node:20.9.0-alpine3.17 | ||
|
||
RUN apk --no-cache add curl | ||
RUN apk add make g++ python3 git | ||
RUN npm i -g node-pre-gyp | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm i | ||
|
||
COPY .env ./.env | ||
COPY src ./src | ||
COPY tsconfig.json ./tsconfig.json | ||
|
||
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,14 @@ | ||
FROM node:20.9.0-alpine3.17 | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm i | ||
|
||
COPY src ./src | ||
COPY tsconfig.json ./tsconfig.json | ||
|
||
RUN npm run build | ||
|
||
CMD npm run start:prod |
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,3 @@ | ||
const nodemailer = require('nodemailer'); | ||
const nodemailermock = require('nodemailer-mock').getMockFor(nodemailer); | ||
module.exports = nodemailermock; |
Oops, something went wrong.