Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #21

Closed
wants to merge 257 commits into from
Closed

Test #21

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
257 commits
Select commit Hold shift + click to select a range
166b7dc
retry front jest test, try to create .env inside pipeline, add echo M…
Jan 30, 2024
dc9f040
retry front jest test, try to create .env inside pipeline, add echo M…
Jan 30, 2024
39c7107
retry front jest test, try to create .env inside pipeline, add echo M…
Jan 30, 2024
5066a24
retry front jest test, try to create .env inside pipeline, add echo M…
Jan 30, 2024
5ec4028
retry front jest test, try to create .env inside pipeline, add echo M…
Jan 30, 2024
df493ba
retry front jest test, try to create .env inside pipeline, add echo M…
Jan 30, 2024
a6d2368
remove useless files and retry pipeline
Khagou Jan 31, 2024
238f7e4
try to change env variable into pipeline to match with DB_USER_PASS
Khagou Jan 31, 2024
8bcb538
modif create env file
Khagou Jan 31, 2024
f4fadf2
modif create env file
Khagou Jan 31, 2024
95ac08f
modif create env file
Khagou Jan 31, 2024
7cd6bc4
changed secret name into github so changed it into env
Khagou Jan 31, 2024
33d0725
changed secret name into github so changed it into env
Khagou Jan 31, 2024
7272d4b
add & after npm run watch
Khagou Jan 31, 2024
9f562b0
modif docker build
Khagou Jan 31, 2024
8d36ea6
modif eskubtrc:js; put eslint:workingdirectories into rules
Khagou Jan 31, 2024
c8d7e2d
modif eskubtrc:js; remove eslint.workingDirectories
Khagou Jan 31, 2024
e03f009
add #{} to nbr_li
Feb 1, 2024
0030951
remove cd client from docker build step
Feb 1, 2024
f3f2971
add eslint and use multi steps
Feb 1, 2024
e282d5a
add eslint and use multi steps, remove eslint.workingdirectories in b…
Feb 1, 2024
f1198f2
add eslint and use multi steps, add dependecies install to each step
Feb 1, 2024
7855750
add eslintignore to ignore ipaddr.js
Feb 1, 2024
8bbc399
add working-directories for eslint tests
Feb 1, 2024
854acc5
modif eslintignore to ignore all node_modules
Feb 1, 2024
e921401
add eslintignore to package.json
Feb 1, 2024
5c849cd
add eslintignore to package.json
Feb 1, 2024
8ccd49f
add eslintignore to package.json
Feb 1, 2024
e942658
add eslintignore to package.json
Feb 1, 2024
df53683
add eslintignore to package.json
Feb 1, 2024
cf56ead
add eslintignore to package.json
Feb 1, 2024
3afe6ee
add eslintignore to package.json
Feb 1, 2024
b88e630
add eslintignore to package.json
Feb 1, 2024
0866948
add eslintignore to package.json
Feb 1, 2024
c20b7e2
add eslintignore to package.json
Feb 1, 2024
0b366ff
add eslintignore to package.json
Feb 1, 2024
4246874
retry without double space
Khagou Feb 3, 2024
9dc56d1
try action-eslint@V3
Khagou Feb 3, 2024
4e8c7f9
try action-eslint@V3, add name to steps
Khagou Feb 3, 2024
7b7eb60
try action-eslint@V3, remove working dir step and add it directly to …
Khagou Feb 3, 2024
e1435b9
try to get reports as artifacts
Khagou Feb 3, 2024
71b2f54
try to get reports as artifacts, add check reports
Khagou Feb 3, 2024
270e980
try to get reports as artifacts, add check reports
Khagou Feb 3, 2024
7e19a19
try to get reports as artifacts, add check reports
Khagou Feb 3, 2024
0fa8cc1
try to get reports as artifacts, add check reports, switch --outputfi…
Khagou Feb 3, 2024
6b5dc62
try to get reports as artifacts, add check reports, switch --outputfi…
Khagou Feb 3, 2024
c46ebee
try to get reports as artifacts, add check reports, add full path
Khagou Feb 3, 2024
62388fc
try to get reports as artifacts, add check reports, add full path
Khagou Feb 3, 2024
d047bf5
try to get reports as artifacts, add check reports, add full path
Khagou Feb 3, 2024
d05a82c
try to get reports as artifacts, add check reports, add full path
Khagou Feb 3, 2024
071c658
try to get reports as artifacts, add !node_modules/**
Khagou Feb 3, 2024
3412727
try to get reports as artifacts, add !node_modules/**
Khagou Feb 3, 2024
f4b050b
try to get reports as artifacts, add !node_modules/**
Khagou Feb 3, 2024
317fba8
try to get reports as artifacts, add !node_modules/**
Khagou Feb 3, 2024
a28dab0
try to get reports as artifacts, add !node_modules/**
Khagou Feb 3, 2024
552e279
try to get reports as artifacts, add !node_modules/**
Khagou Feb 3, 2024
8f59bb2
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 4, 2024
ce2e911
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 4, 2024
34d0c0f
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 4, 2024
a233c09
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 4, 2024
86227c4
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 4, 2024
7964f5e
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 4, 2024
b46eba1
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 4, 2024
02c62da
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 4, 2024
2badfa9
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 4, 2024
57cb4ad
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 4, 2024
608e9fd
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 4, 2024
8f3d222
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 4, 2024
38c1da3
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 4, 2024
184d82b
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 5, 2024
c4250c9
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 6, 2024
b178f4e
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 6, 2024
19370e5
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 6, 2024
c5a7345
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 6, 2024
208e3a2
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 6, 2024
578b434
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 6, 2024
9956b43
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 6, 2024
e667f56
try to get reports as artifacts, add !node_modules/** and run to npm …
Khagou Feb 6, 2024
b0ac91b
try create and upload rapports for jest tests
Khagou Feb 6, 2024
1285704
try create and upload rapports for jest tests
Khagou Feb 6, 2024
e3ae6d1
try create and upload jest reports
Khagou Feb 6, 2024
d1d5349
test eslint
Khagou Feb 6, 2024
e694e37
test eslint
Khagou Feb 6, 2024
e4e75ef
test eslint
Khagou Feb 6, 2024
0147998
test eslint, modif package.json
Khagou Feb 6, 2024
3a6fe54
change **/*.js to .
Khagou Feb 7, 2024
6c157e9
change **/*.js to . and add cd client/server to ci
Khagou Feb 7, 2024
cc25f46
change **/*.js to . and add cd client/server to ci
Khagou Feb 7, 2024
42d3d6a
change **/*.js to . and add cd client/server to ci
Khagou Feb 7, 2024
ebdf357
change **/*.js to . and add cd client/server to ci
Khagou Feb 7, 2024
2b0b042
change **/*.js to . and add cd client/server to ci
Khagou Feb 7, 2024
6336d85
change **/*.js to . and add cd client/server to ci
Khagou Feb 7, 2024
877a97d
change **/*.js to . and add cd client/server to ci
Khagou Feb 7, 2024
3bcef57
change **/*.js to . and add cd client/server to ci
Khagou Feb 7, 2024
fb99254
change **/*.js to . and add cd client/server to ci
Khagou Feb 7, 2024
fc3259e
change **/*.js to . and add cd client/server to ci
Khagou Feb 7, 2024
edc6dc1
change **/*.js to . and add cd client/server to ci
Khagou Feb 7, 2024
f4f5e21
change **/*.js to . and add cd client/server to ci
Khagou Feb 7, 2024
409eaf1
change **/*.js to . and add cd client/server to ci
Khagou Feb 7, 2024
3770fa0
change **/*.js to . and add cd client/server to ci
Khagou Feb 7, 2024
bf45e2f
change **/*.js to . and add cd client/server to ci
Khagou Feb 7, 2024
6f8f3f6
change api url
Khagou Feb 7, 2024
7fd6ff3
change api url
Khagou Feb 7, 2024
eb7c7db
change npm ci to npm install for build and push step
Khagou Feb 7, 2024
04b9ffa
try to fix back image build, wont work on cluster
Khagou Feb 8, 2024
3977665
try to fix back image build, wont work on cluster
Khagou Feb 8, 2024
8fa21e0
try to fix back image build, wont work on cluster
Khagou Feb 8, 2024
54f143f
try to fix back image build, wont work on cluster
Khagou Feb 8, 2024
0d4d2e9
try to fix back image build, wont work on cluster
Khagou Feb 8, 2024
8293f1a
try to fix back image build, wont work on cluster
Khagou Feb 8, 2024
61d4de4
try to fix back image build, wont work on cluster, create .env in pip…
Khagou Feb 9, 2024
e204792
try replace api url by an env var
Khagou Feb 9, 2024
dd5210e
try replace api url by an env var
Khagou Feb 9, 2024
fbbf890
try replace api url by an env var
Khagou Feb 9, 2024
b9021fe
try replace api url by an env var
Khagou Feb 9, 2024
b0b3028
try creates .env files, and do not use env vars
Khagou Feb 10, 2024
5b3640d
try creates .env files, and do not use env vars
Khagou Feb 10, 2024
9e1aa44
try creates .env files, and do not use env vars
Khagou Feb 10, 2024
5a16aca
try creates .env files, and do not use env vars
Khagou Feb 10, 2024
0b06e42
try creates .env files, and do not use env vars
Khagou Feb 10, 2024
d484385
try creates .env files, and do not use env vars
Khagou Feb 10, 2024
d2cded8
try creates .env files, and do not use env vars
Khagou Feb 10, 2024
f445698
try use only env var without care about .env files
Khagou Feb 10, 2024
9df8160
try use only env var without care about .env files
Khagou Feb 10, 2024
ff1e8c8
.gitignore is now working
Khagou Feb 10, 2024
a76bdf9
git wont work
Khagou Feb 10, 2024
3c03f5b
Removed client submodule
Khagou Feb 10, 2024
0045e52
is git now working?
Khagou Feb 10, 2024
eec1cd8
is git now working?
Khagou Feb 10, 2024
3102e9f
is git now working?
Khagou Feb 10, 2024
b6da558
retry ci, then, if everything ok try cd
Khagou Feb 12, 2024
d8e178a
second try cd, try to add permission pull-requests: write
Khagou Feb 12, 2024
39e5749
3 try cd, try to fix push to gar
Khagou Feb 13, 2024
2006981
3 try cd, try to fix push to gar, try pull from hubdocker then push t…
Khagou Feb 13, 2024
87a3259
3 try cd, try to fix push to gar, try pull from hubdocker then push t…
Khagou Feb 13, 2024
ef99cc8
3 try cd, try to fix push to gar, try pull from hubdocker then push t…
Khagou Feb 13, 2024
a9b6095
3 try cd, try to fix push to gar, try pull from hubdocker then push t…
Khagou Feb 13, 2024
2481995
3 try cd, try to fix push to gar, try pull from hubdocker then push t…
Khagou Feb 13, 2024
56afd03
4 try cd, try to fix deploy to gke, try to fix get cluster credential…
Khagou Feb 13, 2024
65a04ec
4 try cd, try to fix deploy to gke, try to fix get cluster credential…
Khagou Feb 13, 2024
f9cd7fc
4 try cd, try to fix deploy to gke, try to fix get cluster credential…
Khagou Feb 13, 2024
eb538e3
4 try cd, try to fix deploy to gke, try to fix get cluster credential…
Khagou Feb 13, 2024
08845a2
4 try cd, try to fix deploy to gke, try to fix get cluster credential…
Khagou Feb 13, 2024
287c405
4 try cd, try to fix deploy to gke, try to fix get cluster credential…
Khagou Feb 13, 2024
395b6cc
4 try cd, try to fix deploy to gke, try to fix get cluster credential…
Khagou Feb 13, 2024
b824409
4 try cd, try to change zone, west1-c looks like full
Khagou Feb 13, 2024
1e0e6f9
deploy cluster in zone not region
Feb 15, 2024
de47bf3
deploy cluster in zone not region
Feb 15, 2024
9ed7704
deploy cluster in zone not region
Feb 15, 2024
bcf2ef3
deploy cluster in zone not region
Feb 15, 2024
72c9d2b
deploy cluster in zone not region
Feb 15, 2024
3efd654
deploy cluster in zone not region
Feb 15, 2024
f4ea15c
deploy cluster in zone not region
Feb 15, 2024
09667f1
everything looks fine for CI and CD, only needs to change api url bec…
Khagou Feb 16, 2024
5988ac4
first try deploy ECK
Khagou Feb 16, 2024
1a4db66
add setup ECK
Khagou Feb 16, 2024
14f7bf5
add check crd to set up ECK
Khagou Feb 16, 2024
1422c46
Add cluster role binding
Khagou Feb 16, 2024
c705547
remove Add cluster role binding
Khagou Feb 16, 2024
58d7376
try add pool to deploy ECK
Khagou Feb 16, 2024
0415072
try add pool to deploy ECK
Khagou Feb 16, 2024
9619836
try add pool to deploy ECK, add autoscaling
Khagou Feb 16, 2024
c121260
try add pool to deploy ECK, add autoscaling
Khagou Feb 16, 2024
8bec2bf
remove initial node count from google_container_cluster
Khagou Feb 19, 2024
a3af02c
try to fix eck agent
Feb 21, 2024
c44c946
add initial node coutn and cluster autoscalling
Feb 21, 2024
8ac6477
add initial node coutn and cluster autoscalling
Feb 21, 2024
814b7e5
add initial node coutn and cluster autoscalling
Feb 21, 2024
d6df637
add initial node coutn and cluster autoscalling
Feb 21, 2024
b1cfa5d
Merge branch 'logging' of github.com:Khagou/khagu-devops into test
Khagou Feb 21, 2024
41dbc2e
try to build on new project
Khagou Mar 4, 2024
759e287
try to build on new project
Khagou Mar 4, 2024
a442cac
modif image fill into kub .yml files
Khagou Mar 4, 2024
ceb52b9
change add loadbalancer api ip, and change docker images version
Khagou Mar 4, 2024
3419c08
change add loadbalancer api ip, and change docker images version
Khagou Mar 4, 2024
e549aeb
change add loadbalancer api ip, and change docker images version
Khagou Mar 4, 2024
8c91ce3
deploy, logging
Khagou Mar 4, 2024
b57885e
deploy, logging
Khagou Mar 4, 2024
788d3c1
deploy, logging on new project 2 add loadbalancer to kibana
Khagou Mar 4, 2024
d3973e4
change resource limits on cluster
Khagou Mar 4, 2024
9185753
change resource limits on cluster, add resource limites on deployment…
Khagou Mar 4, 2024
5d02173
change resource limits on cluster, add resource limites on deployment…
Khagou Mar 4, 2024
6a70d79
change resource limits on cluster, add resource limites on deployment…
Khagou Mar 4, 2024
7e082a7
remove nodeSelector
Khagou Mar 4, 2024
64ba9bd
remove nodeSelector
Khagou Mar 4, 2024
0df7b02
remove nodeSelector
Khagou Mar 4, 2024
74737d6
try fix deployment :(
Khagou Mar 5, 2024
dd7778b
try fix deployment :(
Khagou Mar 5, 2024
d322b66
add disk_size_gb to node_config
Khagou Mar 5, 2024
e024280
add disk_size_gb to node_config
Khagou Mar 5, 2024
d82ffce
add disk_size_gb to node_config
Khagou Mar 5, 2024
8db4a5f
try to fix quotas limit
Khagou Mar 5, 2024
8e65d1e
try to fix quotas limit
Khagou Mar 5, 2024
7e3f179
try to fix quotas limit
Khagou Mar 5, 2024
6a6915d
try to fix quotas limit
Khagou Mar 5, 2024
819b483
modif cluster location from zone to region
Khagou Mar 5, 2024
91f15a3
add namespaces
Khagou Mar 5, 2024
339a71f
augmentation disk size, max node, cpu et memory
Khagou Mar 5, 2024
e782def
test to fix quotas
Khagou Mar 6, 2024
d87d41b
try fix quotas 2
Khagou Mar 6, 2024
e2ba543
try fix quotas 3
Khagou Mar 6, 2024
5f579fd
add create namespace to pipeline
Khagou Mar 6, 2024
24abfa0
try fix quotas 3 4 idk
Khagou Mar 6, 2024
fb7c07e
try fix quotas 3 4 idk
Khagou Mar 6, 2024
ed10e5b
try fix quotas 3 4 idk
Khagou Mar 6, 2024
d1d713e
to switch logging
Khagou Mar 6, 2024
435ddec
try put services to namespaces
Khagou Mar 6, 2024
f44aacb
change memory from 100 1000 to 6 64 in cluster.tf
Khagou Mar 6, 2024
663b492
switch region to west2
Khagou Mar 6, 2024
6a54a5e
e2-standard-2 to standard-4
Khagou Mar 6, 2024
c061870
use img 1.1.3 pour mettre url api a jour
Khagou Mar 7, 2024
22e1b45
switch all to default namespace
Khagou Mar 8, 2024
99c9ec5
forgot some namespace
Khagou Mar 8, 2024
de3d195
new front image 1.1.4
Khagou Mar 8, 2024
e4abbae
changed loadbalancer for nodeport + ingress to add SSL cert
Khagou Mar 18, 2024
184afb6
forgot domain name on ingress
Khagou Mar 18, 2024
b1b2103
try add ingress to front for certificat SSL
Khagou Mar 21, 2024
31c7a1d
modif ingress, remove tls secret
Khagou Mar 21, 2024
06079b9
try de changer loadbalancer du back pour clusterip, ajout activation …
Khagou Mar 22, 2024
7441e4a
try fix connexion api
Khagou Mar 22, 2024
15521c2
reswitch clusterip to loadbalancer for API
Khagou Mar 22, 2024
caa3cb0
remove api from front ingress
Khagou Mar 22, 2024
3dfc601
fix url api
Khagou Mar 22, 2024
2ad13b5
creation ingress pour le back pour SSL car need https
Khagou Mar 22, 2024
1fc3e7e
try connexion api interne au cluster avec middleware sur serveur express
Khagou Mar 23, 2024
23aa64a
modif img number front and back
Khagou Mar 23, 2024
2ffceef
modif url api, re ajout de la variable et modif de celle ci dans gith…
Khagou Mar 23, 2024
cc6c53e
add waitFor to modal.test
Khagou Mar 23, 2024
c1dff7e
try comment "run back server" in CI
Khagou Mar 23, 2024
59624fc
add http-proxy-middleware
Khagou Mar 23, 2024
b94e9dc
modif modal use axios-mock-adapter
Khagou Mar 23, 2024
b1734af
try remove middleware
Khagou Mar 23, 2024
a50a311
rajout middleware
Khagou Mar 23, 2024
bddb656
img back 1.0.9.1
Khagou Mar 23, 2024
03ba8ae
try fix api connexion, modif var api url dans github
Khagou Mar 23, 2024
e7adc24
techroute avant midddleware dans index.js
Khagou Mar 23, 2024
8ed27b5
add Access-Control-Allow-Origin
Khagou Mar 23, 2024
d3c453f
1.0.9.4
Khagou Mar 23, 2024
855be34
modif index, middleware avant route
Khagou Mar 23, 2024
5eaf93c
remise des routes avant middleware
Khagou Mar 24, 2024
fe6bf2e
new front img, modif var api github = https://www.projet.khagu-dev.fr…
Khagou Mar 24, 2024
a369319
modif front ingress, remove projet.khagu-dev.fr host et ajour path /a…
Khagou Mar 24, 2024
f07a9d5
khagu-dev-front:1.1.8.2, change api url par http://back-service.defau…
Khagou Mar 24, 2024
2a0a30d
1.1.8.3 http://back-service.default.svc.cluster.local:7000/api
Khagou Mar 24, 2024
9bac374
ingress et ssl pour requettes https du front vers http back
Khagou Mar 24, 2024
963e062
remove du 1er ingress
Khagou Mar 24, 2024
5b15080
change api url for https://www.projet.khagu-dev.fr/api
Khagou Mar 24, 2024
314095c
sslcrert
Khagou Mar 24, 2024
bb82d96
remove ssl from config file
Khagou Mar 24, 2024
3a3d0b0
rebuild new ingress
Khagou Mar 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
197 changes: 197 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
name: CI # Nom de l'action

on: # Déclencheur de l'action
push: # Déclencheur de l'action lors d'un push
branches: [test] # Déclencheur de l'action lors d'un push sur la branche test

env: # Variables d'environnement declarées dans la vm de l'action
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} # les secrets sont des variables d'environnement sous forme de secrets stockées dans le répertoire secrets du repo sur github
DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
DB_USER_PASS: ${{ secrets.DB_USER_PASS }}
REACT_APP_URL_API: ${{ vars.REACT_APP_LOCAL_URL_API }} # les vars sont des variables d'environnement stockées dans le répertoire vars du repo sur github

jobs: # Jobs de l'action
Jest-tests: # Job de l'action pour les tests Jest
runs-on: ubuntu-latest # Système d'exploitation de la vm

steps: # Etapes du job
- name: Checkout code # Prendre le code du repot en contexte
uses: actions/checkout@v2 # use permet d'utiliser une action déjà existante (ici checkout@v2)

- name: Use Node.js # Installation de Node.js
uses: actions/setup-node@v2
with: # with permet de passer des paramètres à l'action
node-version: 20

- name: Install front dependencies # Installation des dépendances front
run: | # run permet d'exécuter des commandes dans la vm
cd client
npm ci

- name: Install back dependencies # Installation des dépendances back
run: |
cd server
npm ci

- name: Create rapports directory if not exists # Creation du dossier rapports pour les tests front s'il n'existe pas
run: mkdir -p rapports
working-directory: server # working-directory permet de changer le répertoire de travail

- name: Create rapports directory if not exists # Creation du dossier rapports pour les tests back s'il n'existe pas
run: mkdir -p rapports
working-directory: client

- name: Run back Jest tests # execution des tests Jest du backend
run: |
cd server
npm test
mv ./test-report.html ./back-jest-report.html

# - name: run back server # execution du serveur backend afin de pouvoir executer l'ensemble des tests du front
# run: |
# cd server
# npm run watch &

- name: Run front Jest tests # execution des tests Jest du frontend
run: |
cd client
npm test
mv ./test-report.html ./front-jest-report.html

- name: Upload reports # Upload des rapports de tests (les tests tournant sur une vm, les rapports sont uploadés pour consultation car ils ne sont pas accessibles directement sur la vm)
uses: actions/upload-artifact@v3
with:
name: jest reports
path: | # path permet de spécifier le chemin des fichiers à uploader
./client/front-jest-report.html
./server/back-jest-report.html

Eslint-test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 20

- name: Install front dependencies
run: |
npm ci
working-directory: client

- name: Install back dependencies
run: |
npm ci
working-directory: server

- name: Where am i
run: |
pwd
ls

- name: Where am i server
run: |
pwd
ls -la
working-directory: server

- name: Where am i client
run: |
pwd
ls -la
working-directory: client

- name: Create eslint directory if not exists
run: mkdir -p eslint
working-directory: server

- name: Create eslint directory if not exists
run: mkdir -p eslint
working-directory: client

- name: Run front Eslint test
run: |
npm run lint || true
working-directory: client

- name: Run back Eslint test
run: |
npm run lint || true
working-directory: server

- name: Eslint reports
uses: actions/upload-artifact@v3
with:
name: eslint reports
path: |
client/eslint-report.html
server/eslint-report.html

build-and-push:
needs: [Jest-tests, Eslint-test]
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 20

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Install front dependencies
run: |
cd client
npm install

- name: Create .env files
run: |
echo "DB_USER_PASS=${{ secrets.DB_USER_PASS }}" > ./server/config/.env
cat ./server/config/.env
echo "REACT_APP_URL_API=${{ secrets.REACT_APP_URL_API }}" > ./client/.env
cat ./client/.env

- name: Build front
if: ${{ success() }}
env:
REACT_APP_URL_API: ${{ secrets.REACT_APP_URL_API }}
run: |
cd client
npm run build

- name: Build and push front
uses: docker/build-push-action@v2
env:
REACT_APP_URL_API: ${{ secrets.REACT_APP_URL_API }}
with:
context: ./client/
file: ./client/Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ vars.DOCKER_FRONT }}:${{ vars.DOCKER_FRONT_VERSION }}

- name: Build and push back
uses: docker/build-push-action@v2
env:
DB_USER_PASS: ${{ secrets.DB_USER_PASS }}
with:
context: ./server/
file: ./server/Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ vars.DOCKER_BACK }}:${{ vars.DOCKER_BACK_VERSION }}
59 changes: 59 additions & 0 deletions .github/workflows/logging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Pipeline Logging

on:
push:
branches:
- logging
pull_request:
branches:
- logging

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: "Google auth"
id: "auth"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GOOGLE_CREDENTIALS }}"

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCP_PROJECT }}
install_components: "gke-gcloud-auth-plugin"

- name: Configure gcloud
run: gcloud config set compute/region europe-west2

- name: Get cluster credential
uses: google-github-actions/get-gke-credentials@v1
with:
cluster_name: khagu-dev-cluster
location: europe-west2

- name: Set up ECK
run: |
# Liste des CRDs ECK
crds=("agents.agent.k8s.elastic.co" "apmservers.apm.k8s.elastic.co" "beats.beat.k8s.elastic.co" "elasticmapsservers.maps.k8s.elastic.co" "elasticsearchautoscalers.autoscaling.k8s.elastic.co" "elasticsearches.elasticsearch.k8s.elastic.co" "enterprisesearches.enterprisesearch.k8s.elastic.co" "kibanas.kibana.k8s.elastic.co" "logstashes.logstash.k8s.elastic.co" "stackconfigpolicies.stackconfigpolicy.k8s.elastic.co")

# Vérifiez chaque CRD
for crd in "${crds[@]}"
do
if ! kubectl get crd $crd > /dev/null 2>&1; then
# Si le CRD n'existe pas, créez les CRDs
kubectl create -f https://download.elastic.co/downloads/eck/2.11.1/crds.yaml
break
fi
done

# Appliquez l'opérateur ECK
kubectl apply -f https://download.elastic.co/downloads/eck/2.11.1/operator.yaml

- name: Deploy to GKE
run: |
kubectl apply -f ./logging/fleet.yml
Loading
Loading