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

part11-2 OK #208

Open
wants to merge 107 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
89fab66
part11-2 OK
EK-Kisler Aug 27, 2024
b573c03
workflows created successfully
EK-Kisler Aug 27, 2024
1707a7f
Merge pull request #1 from ekisler/development
ekisler Aug 27, 2024
7f3f30c
Corrección del workflow
EK-Kisler Aug 27, 2024
fa3be96
Merge pull request #2 from ekisler/development
ekisler Aug 27, 2024
b6726a3
Add date to workflow
EK-Kisler Aug 27, 2024
9cda7a1
Merge pull request #3 from ekisler/development
ekisler Aug 27, 2024
479832d
Correción de workflow
EK-Kisler Aug 27, 2024
aaa39fe
Merge pull request #4 from ekisler/development
ekisler Aug 27, 2024
e91a217
Correción de workflow
EK-Kisler Aug 27, 2024
0b1319f
Merge pull request #5 from ekisler/development
ekisler Aug 27, 2024
17ee55b
part11-4 to 11-5 OK
EK-Kisler Aug 28, 2024
28d5474
Merge pull request #6 from ekisler/development
ekisler Aug 28, 2024
c6d0d74
Correccion de eslint
EK-Kisler Aug 28, 2024
53ccf23
Merge pull request #7 from ekisler/development
ekisler Aug 28, 2024
a10ce07
Reparando todos los problemas del workflow
EK-Kisler Aug 28, 2024
0196a84
Merge pull request #8 from ekisler/development
ekisler Aug 28, 2024
d3a2ded
part11-6 OK
EK-Kisler Aug 28, 2024
c0ed434
Merge pull request #9 from ekisler/development
ekisler Aug 28, 2024
0d8ebbd
part11-7 OK
EK-Kisler Aug 28, 2024
b593725
Merge pull request #10 from ekisler/feature/part11-7
ekisler Aug 28, 2024
fdbec8f
Merge pull request #11 from ekisler/development
ekisler Aug 28, 2024
a03b513
part11-7 OK
EK-Kisler Aug 28, 2024
beb1de5
Merge pull request #12 from ekisler/feature/part11-7
ekisler Aug 28, 2024
6a54e7e
Merge pull request #13 from ekisler/development
ekisler Aug 28, 2024
174a794
part11-8 OK
EK-Kisler Aug 28, 2024
92c0286
Merge pull request #14 from ekisler/feature/part11-7
ekisler Aug 28, 2024
5491dc2
Merge pull request #15 from ekisler/development
ekisler Aug 28, 2024
a33d974
part11-9 OK
EK-Kisler Aug 28, 2024
efe02da
Merge pull request #16 from ekisler/development
ekisler Aug 28, 2024
2fcdedc
part11-9 OK
EK-Kisler Aug 28, 2024
73014d2
Merge pull request #17 from ekisler/development
ekisler Aug 28, 2024
4259747
part11-9 OK
EK-Kisler Aug 28, 2024
4602322
Merge pull request #18 from ekisler/development
ekisler Aug 28, 2024
a3632d8
Creando build_step para deploy
EK-Kisler Aug 28, 2024
fbc2464
Resolviendo extension del index erronea
EK-Kisler Aug 28, 2024
3463854
Resolviendo extension del index erronea
EK-Kisler Aug 28, 2024
4061445
Resolviendo extension del index erronea
EK-Kisler Aug 28, 2024
2ba8164
Corriegiendo archivo config.js type module ok
EK-Kisler Aug 29, 2024
c68793f
Corriegiendo archivo webpack type module ok
EK-Kisler Aug 29, 2024
54fe67f
Corrigiendo playwitght para deploy
EK-Kisler Aug 29, 2024
0226706
Impplementando ci para render_api_key
EK-Kisler Aug 29, 2024
04b0970
Correccion de extension del archivo index del src
EK-Kisler Aug 29, 2024
12dddf3
Correccion de extension del index en diferentes archivos
EK-Kisler Aug 29, 2024
3ffd89f
cmabiando index a bundle en el main de package json
EK-Kisler Aug 29, 2024
dce92bc
editando el json para deploy
EK-Kisler Aug 29, 2024
4ee9027
configurando webpack y json para deploy
EK-Kisler Aug 29, 2024
09c108c
configurando webpack y json para deploy
EK-Kisler Aug 29, 2024
1c70889
configurando webpack y json para deploy
EK-Kisler Aug 29, 2024
00b85e7
Incluyendo dist para produccion
EK-Kisler Aug 29, 2024
fd385ef
Correciones generales en json
EK-Kisler Aug 30, 2024
52e4172
Correciones generales en json
EK-Kisler Aug 30, 2024
a304e9a
Correciones generales en json
EK-Kisler Aug 30, 2024
6fc72ee
Correciones generales en json
EK-Kisler Aug 30, 2024
f9335e8
nueva prueba
EK-Kisler Aug 30, 2024
5f7e3b0
nueva prueba
EK-Kisler Aug 30, 2024
0a93acd
nueva prueba
EK-Kisler Aug 30, 2024
1155e55
nueva prueba
EK-Kisler Aug 30, 2024
6ff26d3
nueva prueba
EK-Kisler Aug 30, 2024
da69111
nueva prueba
EK-Kisler Aug 30, 2024
95262ff
nueva prueba
EK-Kisler Aug 30, 2024
d289c18
Organizando README
EK-Kisler Aug 30, 2024
f1c2023
Merge branch 'main' into development
EK-Kisler Aug 30, 2024
b202d9d
Merge pull request #19 from ekisler/development
ekisler Aug 30, 2024
26c89b2
Merge pull request #20 from ekisler/development
ekisler Aug 30, 2024
348bfb7
Agregando middleware de salud
EK-Kisler Aug 30, 2024
2c18920
Agregando dist al ignore
EK-Kisler Aug 30, 2024
07a9580
Probando error el health
EK-Kisler Aug 30, 2024
b4b7a0d
part11-12 Render OK
EK-Kisler Aug 30, 2024
929faa8
Modificando solicitud de extraccion de workflow
EK-Kisler Aug 30, 2024
36b0026
Bloquea push directo al main
EK-Kisler Aug 30, 2024
adfb8c2
prueba directa a main push directo
EK-Kisler Aug 30, 2024
c65a884
Borrando prueba
EK-Kisler Aug 30, 2024
e41313a
part11-10 to 11-15 OK
EK-Kisler Aug 30, 2024
bfd71b6
part11-10 to 11-15 OK
EK-Kisler Aug 30, 2024
9912f24
part11-10 to 11-15 OK
EK-Kisler Aug 30, 2024
486afaf
part11-10 to 11-15 OK
EK-Kisler Aug 30, 2024
ab6b1ea
part11-10 to 11-15 OK
EK-Kisler Aug 30, 2024
9418727
part11-16 OK
EK-Kisler Aug 31, 2024
cfc33cf
part11-16 OK
EK-Kisler Aug 31, 2024
c94bdbd
part11-16 OK prueba de #skip
EK-Kisler Aug 31, 2024
0df6bf8
Pruebaen cambio de version 1.64.0 a 1.70.0 para mi workflow
EK-Kisler Aug 31, 2024
7ccacb9
Cambio de version 1.70.0 a hash 777684df761b882a3f4f70db16ac70d8cc78d…
EK-Kisler Aug 31, 2024
a78f130
Prueba #pathc del versionado
EK-Kisler Aug 31, 2024
ce35b33
Prueba #patch del versionado
EK-Kisler Aug 31, 2024
4369dce
part11-18 OK
EK-Kisler Aug 31, 2024
7799aed
Corrigiendoo error discord message
EK-Kisler Aug 31, 2024
a5f2398
Corrigiendoo error discord message
EK-Kisler Aug 31, 2024
f252bde
Corrigiendoo error discord message
EK-Kisler Aug 31, 2024
2ad85de
Corrigiendoo error discord message
EK-Kisler Aug 31, 2024
0c7cd20
Corrigiendoo error discord message
EK-Kisler Aug 31, 2024
bc9d3a7
Corrigiendoo error discord message cambio action
EK-Kisler Aug 31, 2024
b503bcc
Corrigiendoo error discord message cambio action
EK-Kisler Aug 31, 2024
48bb6c9
part11-19 OK
EK-Kisler Aug 31, 2024
d8ec9b3
Enviando mensaje a discord del health app
EK-Kisler Sep 1, 2024
b4b1028
Enviando mensaje a discord del health app, cmabiando version a hash e…
EK-Kisler Sep 1, 2024
46c42a1
Enviando mensaje a discord del health app yml #patch
EK-Kisler Sep 1, 2024
870f7b6
Enviando mensaje a discord del health app yml con color #patch
EK-Kisler Sep 1, 2024
73d171a
Enviando mensaje a discord del health app yml correcion #patch
EK-Kisler Sep 1, 2024
45ee20a
Update submodule part11-20
EK-Kisler Sep 1, 2024
7dc4060
Update submodule part11-20
EK-Kisler Sep 1, 2024
bc82171
Borrando submodule
EK-Kisler Sep 1, 2024
c8818ee
Borrando submodule
EK-Kisler Sep 1, 2024
a1ef613
part11-21 OK
EK-Kisler Sep 1, 2024
580a41d
part11-21 OK
EK-Kisler Sep 1, 2024
599c86b
Corrigiendo error en url healt ci
EK-Kisler Sep 2, 2024
f9f08d1
Please mluukkai check my code
EK-Kisler Sep 2, 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
66 changes: 23 additions & 43 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,29 @@
// eslint-disable-next-line no-undef
module.exports = {
"env": {
"browser": true,
"es6": true,
"jest/globals": true
env: {
browser: true,
es6: true,
"jest/globals": true,
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
extends: ["eslint:recommended", "plugin:react/recommended"],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
"ecmaVersion": 2018,
"sourceType": "module"
ecmaVersion: 2018,
sourceType: "module",
},
"plugins": [
"react", "jest"
],
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"never"
],
"eqeqeq": "error",
plugins: ["react", "jest"],
rules: {
indent: ["error", 2],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
eqeqeq: "error",
"no-trailing-spaces": "error",
"object-curly-spacing": [
"error", "always"
],
"arrow-spacing": [
"error", { "before": true, "after": true }
],
"object-curly-spacing": ["error", "always"],
"arrow-spacing": ["error", { before: true, after: true }],
"no-console": "error",
"react/prop-types": 0
}
}
"react/prop-types": 0,
},
};
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# .github/workflows/ci.yml
name: Deployment pipeline

on:
push:
branches:
- main
pull_request:
branches: [main]
types: [opened, synchronize]

jobs:
simple_deployment_pipeline:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libnss3 \
libxss1 \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libcups2 \
libdbus-glib-1-2 \
libgdk-pixbuf2.0-0 \
libgtk-3-0 \
libpango1.0-0 \
libx11-xcb1 \
libxcomposite1 \
libxrandr2 \
libxdamage1 \
libxext6 \
libxi6 \
libxtst6 \
libxss1 \
libgbm1 \
libopus0 \
libvpx7 \
libglib2.0-0 \
libgstreamer1.0-0 \
libgstreamer-plugins-base1.0-0

- name: Install dependencies
run: npm install

- name: Install Playwright Browsers
run: npx playwright install --with-deps

- name: Test
run: npm run test

- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@0c4b27844ba47cb1c7bee539c8eead5284ce9fa9
with:
args: 'The project {{ EVENT_PAYLOAD.repository.full_name }} has been deployed. Please mluukkai check my code!'


tag_release:
needs: simple_deployment_pipeline
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

# Agregar #major, #minor o #patch en el commit
- name: Bump version and push tag
if: ${{ github.event_name == 'push' && !contains(github.event.head_commit.message, '#skip') }}
uses: anothrNick/github-tag-action@777684df761b882a3f4f70db16ac70d8cc78d0ea
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true

- name: Deploy
if: ${{ github.event_name == 'push' }}
env:
deploy_url: ${{ secrets.RENDER_API_KEY }}
run: |
curl "$deploy_url"
31 changes: 31 additions & 0 deletions .github/workflows/health-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Health Check

on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

jobs:
health_check:
runs-on: ubuntu-latest
steps:
- name: Check the deployed service URL
uses: jtalk/url-health-check-action@v4
with:
# I changed the url by mistake and deleted it from render
url: https://full-stack-open-pokedex-txnk.onrender.com
follow-redirect: false
max-attempts: 3
retry-delay: 5s
retry-all: false
cookie: ""
basic-auth: ""


- name: Discord health notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@0c4b27844ba47cb1c7bee539c8eead5284ce9fa9
with:
args: 'The project {{ EVENT_PAYLOAD.repository.full_name }} is healthy!'

26 changes: 26 additions & 0 deletions .github/workflows/hello.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Hello World!

on:
push:
branches:
- main

jobs:
hello_world_job:
runs-on: ubuntu-20.04
steps:
- name: Say hello
run: |
echo "Hello World!"

- name: Now it is
run: |
echo "date: $(date)"

- name: Directory content
run: |
ls -lR .
echo "Directory contents:"
ls -l


30 changes: 30 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Build the application
run: npm run build
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30

10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
dist/
node_modules/
node_modules/
package-lock.json
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
.pipeline.yml
dist
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "part11-20"]
path = part11-20
url = https://github.com/ekisler/part11-20
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.x
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ This repository is used for the CI/CD module of the Full stack open course

Fork the repository to complete course exercises

## Live Application

You can view the live application [here](https://full-stack-open-pokedex-igs4.onrender.com).

## Certificate

You can view my certificate [here](https://studies.cs.helsinki.fi/stats/api/certificate/fs-react-native-2020/en/3a83e91eaabad9f73ed3e20b2dbd3947).

## Commands

Start by running `npm install` inside the project folder
Expand Down
9 changes: 9 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
// eslint-disable-next-line no-undef
const express = require("express");
const app = express();

app.use(express.json());

// get the port from env variable
// eslint-disable-next-line no-undef
const PORT = process.env.PORT || 5000;

app.use(express.static("dist"));

app.get("/health", (req, res) => {
res.send("ok");
});

app.listen(PORT, () => {
// eslint-disable-next-line no-console
console.log(`server started on port ${PORT}`);
});
5 changes: 5 additions & 0 deletions build_step.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

echo "Build script"

# add the commands here
Loading