From 8ad80002691048b0115a6ae5f865053507597bbe Mon Sep 17 00:00:00 2001 From: pglez82 Date: Sat, 28 Jan 2023 12:25:29 +0100 Subject: [PATCH] customizing for en3b --- .../workflows/{lomap_0.yml => lomap_en3b.yml} | 8 +++---- README.md | 22 +++++++++---------- README_es.md | 16 +++++++------- docker-compose-deploy.yml | 4 ++-- docs/README.md | 4 ++-- docs/README_es.md | 4 ++-- docs/index.adoc | 2 +- restapi/Dockerfile | 2 +- sonar-project.properties | 4 ++-- webapp/Dockerfile | 2 +- webapp/README.md | 2 +- webapp/README_es.md | 2 +- webapp/src/App.tsx | 2 +- 13 files changed, 37 insertions(+), 37 deletions(-) rename .github/workflows/{lomap_0.yml => lomap_en3b.yml} (94%) diff --git a/.github/workflows/lomap_0.yml b/.github/workflows/lomap_en3b.yml similarity index 94% rename from .github/workflows/lomap_0.yml rename to .github/workflows/lomap_en3b.yml index c1613ab..e7f0b7f 100644 --- a/.github/workflows/lomap_0.yml +++ b/.github/workflows/lomap_en3b.yml @@ -1,4 +1,4 @@ -name: CI for LOMAP_0 +name: CI for lomap_en3b on: release: @@ -62,7 +62,7 @@ jobs: env: API_URI: http://${{ secrets.DEPLOY_HOST }}:5000/api with: - name: arquisoft/lomap_0/webapp + name: arquisoft/lomap_en3b/webapp username: ${{ github.actor }} password: ${{ secrets.DOCKER_PUSH_TOKEN }} registry: ghcr.io @@ -77,7 +77,7 @@ jobs: - name: Publish to Registry uses: elgohr/Publish-Docker-Github-Action@v5 with: - name: arquisoft/lomap_0/restapi + name: arquisoft/lomap_en3b/restapi username: ${{ github.actor }} password: ${{ secrets.DOCKER_PUSH_TOKEN }} registry: ghcr.io @@ -94,7 +94,7 @@ jobs: # user: ${{ secrets.DEPLOY_USER }} # key: ${{ secrets.DEPLOY_KEY }} # command: | - # wget https://raw.githubusercontent.com/arquisoft/lomap_0/master/docker-compose-deploy.yml -O docker-compose.yml + # wget https://raw.githubusercontent.com/arquisoft/lomap_en3b/master/docker-compose-deploy.yml -O docker-compose.yml # docker-compose stop # docker-compose rm -f # docker-compose pull diff --git a/README.md b/README.md index ad7aa52..7cec016 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# lomap_0 +# lomap_en3b -[![Actions Status](https://github.com/arquisoft/lomap_0/workflows/CI%20for%20LOMAP_0/badge.svg)](https://github.com/arquisoft/lomap_0/actions) -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_lomap_0&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Arquisoft_lomap_0) -[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_lomap_0&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Arquisoft_lomap_0) +[![Actions Status](https://github.com/arquisoft/lomap_en3b/workflows/CI%20for%20LOMAP_EN3B/badge.svg)](https://github.com/arquisoft/lomap_en3b/actions) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_lomap_en3b&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Arquisoft_lomap_en3b) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_lomap_en3b&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Arquisoft_lomap_en3b)

@@ -16,7 +16,7 @@ This project is a basic example of website using **React** with **Typescript** a ## Quick start guide In case you already have node.js and npm, make sure you update them before attempting to build the images -If you want to execute the project you will need [git](https://git-scm.com/downloads), [Node.js and npm](https://www.npmjs.com/get-npm) and [Docker](https://docs.docker.com/get-docker/). Make sure the three of them are installed in your system. Download the project with `git clone https://github.com/arquisoft/lomap_0`. The fastest way to launch everything is with docker: +If you want to execute the project you will need [git](https://git-scm.com/downloads), [Node.js and npm](https://www.npmjs.com/get-npm) and [Docker](https://docs.docker.com/get-docker/). Make sure the three of them are installed in your system. Download the project with `git clone https://github.com/arquisoft/lomap_en3b`. The fastest way to launch everything is with docker: ```bash docker-compose up --build ``` @@ -46,9 +46,9 @@ You should be able to access the application in [http://localhost:3000](http://l ## More information You can get more information about the repository in the other README files: -- Documentation: https://github.com/arquisoft/lomap_0/tree/master/docs -- Webapp: https://github.com/arquisoft/lomap_0/tree/master/webapp -- Restapi: https://github.com/arquisoft/lomap_0/tree/master/restapi +- Documentation: https://github.com/arquisoft/lomap_en3b/tree/master/docs +- Webapp: https://github.com/arquisoft/lomap_en3b/tree/master/webapp +- Restapi: https://github.com/arquisoft/lomap_en3b/tree/master/restapi ## Deployment @@ -195,11 +195,11 @@ Now we are going to create a new docker-compose file called docker-compose-deplo version: '3.5' services: restapi: - image: ghcr.io/arquisoft/lomap_0/restapi:latest + image: ghcr.io/arquisoft/lomap_en3b/restapi:latest ports: - "5000:5000" webapp: - image: ghcr.io/arquisoft/lomap_0/webapp:latest + image: ghcr.io/arquisoft/lomap_en3b/webapp:latest ports: - "3000:3000" depends_on: @@ -222,7 +222,7 @@ deploy: user: ${{ secrets.DEPLOY_USER }} key: ${{ secrets.DEPLOY_KEY }} command: | - wget https://raw.githubusercontent.com/arquisoft/lomap_0/master/docker-compose-deploy.yml -O docker-compose.yml + wget https://raw.githubusercontent.com/arquisoft/lomap_en3b/master/docker-compose-deploy.yml -O docker-compose.yml docker-compose stop docker-compose rm -f docker-compose pull diff --git a/README_es.md b/README_es.md index c40a2a8..d47b6c1 100644 --- a/README_es.md +++ b/README_es.md @@ -1,8 +1,8 @@ -# lomap_0 +# lomap_en3b -[![Actions Status](https://github.com/arquisoft/lomap_0/workflows/CI%20for%20LOMAP_0/badge.svg)](https://github.com/arquisoft/lomap_0/actions) -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_lomap_0&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Arquisoft_lomap_0) -[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_lomap_0&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Arquisoft_lomap_0) +[![Actions Status](https://github.com/arquisoft/lomap_en3b/workflows/CI%20for%20LOMAP_EN3B/badge.svg)](https://github.com/arquisoft/lomap_en3b/actions) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_lomap_en3b&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Arquisoft_lomap_en3b) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_lomap_en3b&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Arquisoft_lomap_en3b)

@@ -16,7 +16,7 @@ Este proyecto es un ejemplo básico de un sitio web utilizando **React** con **T Si tienes instalados node.js y npm, asegúrate de actualizarlos antes de intentar construir las imagenes -Si quieres ejecutar el proyecto necesitarás [git](https://git-scm.com/downloads), [Node.js and npm](https://www.npmjs.com/get-npm) y [Docker](https://docs.docker.com/get-docker/). Asegúrate de tenerlos instalados en tu equipo. Descarga el proyecto con `git clone https://github.com/arquisoft/lomap_0`. La manera más rápida de ejecutar todo es con Docker. +Si quieres ejecutar el proyecto necesitarás [git](https://git-scm.com/downloads), [Node.js and npm](https://www.npmjs.com/get-npm) y [Docker](https://docs.docker.com/get-docker/). Asegúrate de tenerlos instalados en tu equipo. Descarga el proyecto con `git clone https://github.com/arquisoft/lomap_en3b`. La manera más rápida de ejecutar todo es con Docker. ```bash docker-compose up --build @@ -47,6 +47,6 @@ Deberías ser capaz de acceder a la aplicación en [http://localhost:3000](http: ## Mas información Encontrarás más información sobre el repositorio en los otros archivos README: -- Documentación: https://github.com/arquisoft/lomap_0/tree/master/docs -- Webapp: https://github.com/arquisoft/lomap_0/tree/master/webapp -- Restapi: https://github.com/arquisoft/lomap_0/tree/master/restapi +- Documentación: https://github.com/arquisoft/lomap_en3b/tree/master/docs +- Webapp: https://github.com/arquisoft/lomap_en3b/tree/master/webapp +- Restapi: https://github.com/arquisoft/lomap_en3b/tree/master/restapi diff --git a/docker-compose-deploy.yml b/docker-compose-deploy.yml index 2fb3e2d..7d37810 100644 --- a/docker-compose-deploy.yml +++ b/docker-compose-deploy.yml @@ -1,11 +1,11 @@ version: '3.5' services: restapi: - image: ghcr.io/arquisoft/lomap_0/restapi:latest + image: ghcr.io/arquisoft/lomap_en3b/restapi:latest ports: - "5000:5000" webapp: - image: ghcr.io/arquisoft/lomap_0/webapp:latest + image: ghcr.io/arquisoft/lomap_en3b/webapp:latest ports: - "3000:3000" depends_on: diff --git a/docs/README.md b/docs/README.md index 16447b2..9e62f48 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ ## The documentation In this project the documentation is compiled locally and deployed to GitHub pages. -The deployment url is: [https://arquisoft.github.io/lomap_0/](https://arquisoft.github.io/lomap_0/). +The deployment url is: [https://arquisoft.github.io/lomap_en3b/](https://arquisoft.github.io/lomap_en3b/). ### Documentation build For the documentation we are going to use [AsciiDoc](https://asciidoc.org/) and [PlantUML](https://plantuml.com) and follows the [Arc42](https://github.com/arc42/arc42-template) template. If you want to be able to generate the doc locally you need to install Ruby, Java and some dependencies to translate the asciidoc code into html. If you are in Linux you can install Ruby and Java simply by executing: @@ -30,6 +30,6 @@ npm run build The documentation will be generated under the `docs/build` directory. ### Documentation deployment -If we want to deploy it to GitHub pages, so it is accesible via [https://arquisoft.github.io/lomap_0/](https://arquisoft.github.io/lomap_0/) we need to execute `npm run deploy`. +If we want to deploy it to GitHub pages, so it is accesible via [https://arquisoft.github.io/lomap_en3b/](https://arquisoft.github.io/lomap_en3b/) we need to execute `npm run deploy`. If you check the `package.json` in this directory you can see how deploying is as easy as executing `gh-pages -d build`, which can be directly executed using `npm run deploy` in the docs directory. The `gh-pages` package is in charge of pushing the documentation generated directory (basically some htmls) to a special github branch called gh-pages. Everything pushed to this branch is accessible in the repository page. Note that we only want to push there the documentation. Also is important that the documentation build is not pushed to the other branches of the project. \ No newline at end of file diff --git a/docs/README_es.md b/docs/README_es.md index c24d112..d9a529f 100644 --- a/docs/README_es.md +++ b/docs/README_es.md @@ -1,6 +1,6 @@ ## Documentación La documentación de este proyecto se compila localmente y se despliega en GitHub pages. -la url en la que se despliega es: [https://arquisoft.github.io/lomap_0/](https://arquisoft.github.io/lomap_0/). +la url en la que se despliega es: [https://arquisoft.github.io/lomap_en3b/](https://arquisoft.github.io/lomap_en3b/). ### Build Documentación For the documentation we are going to use [AsciiDoc](https://asciidoc.org/) and [PlantUML](https://plantuml.com) and follows the [Arc42](https://github.com/arc42/arc42-template) template. If you want to be able to generate the doc locally you need to install Ruby and some dependencies to translate the asciidoc code into html: @@ -32,6 +32,6 @@ npm run build La documentación se generará en el directorio `docs/build`. ### Despliegue Documentación -Si queremos desplegar la documentación en GitHub pages, estará accesible en [https://arquisoft.github.io/lomap_0/](https://arquisoft.github.io/lomap_0/) necesitamos ejecutar `npm run deploy`. +Si queremos desplegar la documentación en GitHub pages, estará accesible en [https://arquisoft.github.io/lomap_en3b/](https://arquisoft.github.io/lomap_en3b/) necesitamos ejecutar `npm run deploy`. Si revisas el `package.json` de este directorio veras como desplegar es tan fácil como ejecutar `gh-pages -d build`, que puede hacerse ejecutando directamente `npm run deploy` en el directorio de la documentación. el paquete `gh-pages` se encarga de subir la documentación generada (básicamente archivo html) a una rama especial de github llamada gh-pages. Todo lo que se suba a esa rama es accesible en la página del repositorio. Ten en cuenta que solo queremos subir ahí la documentación. También es importante que el build de la documentación no se suba a otras ramas del proyecto. \ No newline at end of file diff --git a/docs/index.adoc b/docs/index.adoc index 31e9a95..d2aac52 100644 --- a/docs/index.adoc +++ b/docs/index.adoc @@ -3,7 +3,7 @@ // // ==================================== -= image:LogoASW.png[arc42] LOMAP_0 += image:LogoASW.png[arc42] LOMAP_EN3B // toc-title definition MUST follow document title without blank line! :toc: left :toc-title: Table of Contents diff --git a/restapi/Dockerfile b/restapi/Dockerfile index 248835f..e7c8634 100644 --- a/restapi/Dockerfile +++ b/restapi/Dockerfile @@ -1,5 +1,5 @@ FROM node:18.13.0 -LABEL org.opencontainers.image.source https://github.com/Arquisoft/lomap_0 +LABEL org.opencontainers.image.source https://github.com/Arquisoft/lomap_en3b COPY . /app WORKDIR /app #Install the dependencies diff --git a/sonar-project.properties b/sonar-project.properties index 8af4cc2..207e077 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,9 +1,9 @@ sonar.organization=arquisoft sonar.host.url=https://sonarcloud.io -sonar.projectKey=Arquisoft_lomap_0 +sonar.projectKey=Arquisoft_lomap_en3b sonar.language=ts -sonar.projectName=lomap_0 +sonar.projectName=lomap_en3b sonar.projectVersion=1.0.4 sonar.coverage.exclusions=**/*.test.tsx,**/*.test.ts diff --git a/webapp/Dockerfile b/webapp/Dockerfile index 18e393a..d45803d 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -1,5 +1,5 @@ FROM node:18.13.0 -LABEL org.opencontainers.image.source https://github.com/arquisoft/lomap_0 +LABEL org.opencontainers.image.source https://github.com/arquisoft/lomap_en3b COPY . /app WORKDIR /app #Install the dependencies diff --git a/webapp/README.md b/webapp/README.md index 82449d7..4193ac0 100644 --- a/webapp/README.md +++ b/webapp/README.md @@ -44,7 +44,7 @@ docker-compose down ### Continuous integration/Continuous Delivery In this step we are going to setup GitHub Actions in order to have CI in our system. The idea is that, every time we create a new release, build the system (restapi and webapp), run the tests, and if everything is ok, build the docker images and upload them to Github packages. Then we can deploy the application using these images. -The workflow for this is in [lomap_0.yml](.github/workflow/lomap_0.yml). In this file you can see that there are two jobs, one for the restapi, one for the webapp. Jobs are executed in paralel so this will speed up our build. +The workflow for this is in [lomap_en3b.yml](.github/workflow/lomap_en3b.yml). In this file you can see that there are two jobs, one for the restapi, one for the webapp. Jobs are executed in paralel so this will speed up our build. So, the first to jobs in this file build the webapp and the restapi (in parallel). If everything goes well, check the e2e tests (later in this document) and if these acceptance tests pass ok, create the docker images and deploy them. diff --git a/webapp/README_es.md b/webapp/README_es.md index 8789049..594e1d6 100644 --- a/webapp/README_es.md +++ b/webapp/README_es.md @@ -45,7 +45,7 @@ docker-compose down En esta etapa vamos a configurar GitHub Actions para tener CI en nuestro sistema. La idea es que cada vez que creemos una nuevo entregable (release) se construya el sistema (restapi y webapi), se ejecuten los tests y si todo funciona correctamente se construirán las imágenes de docker y se subirán a GiHub packages. Entonces podremos desplegar nuestra nuestra aplicación utilizando estas imágenes. -El flujo de trabajo se encuentra en el archivo [lomap_0.yml](.github/workflows/lomap_0.yml). Si lo revisas podrás ver que existen dos trabajos, uno para la restapi(**unit-test-restapi**) y otro para la webapp(**unit-test-webapp**). Estos trabajos se ejecutan de forma paralela por lo que aceleran la construcción de las imágenes. +El flujo de trabajo se encuentra en el archivo [lomap_en3b.yml](.github/workflows/lomap_en3b.yml). Si lo revisas podrás ver que existen dos trabajos, uno para la restapi(**unit-test-restapi**) y otro para la webapp(**unit-test-webapp**). Estos trabajos se ejecutan de forma paralela por lo que aceleran la construcción de las imágenes. Si todo va bien revisarán los tests e2e (end to end) y si estos test de aceptación pasan se crearán las imágenes de docker y se desplegarán. diff --git a/webapp/src/App.tsx b/webapp/src/App.tsx index 7774fc0..dd2e899 100644 --- a/webapp/src/App.tsx +++ b/webapp/src/App.tsx @@ -28,7 +28,7 @@ function App(): JSX.Element { This is a basic example of a React application using Typescript. You can add your email to the list filling the form below. - Source code + Source code );