Skip to content

Commit

Permalink
customizing for group en2a
Browse files Browse the repository at this point in the history
  • Loading branch information
pglez82 committed Jan 28, 2023
1 parent 8149b40 commit 85ee68a
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI for LOMAP_0
name: CI for LOMAP_EN2A

on:
release:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
env:
API_URI: http://${{ secrets.DEPLOY_HOST }}:5000/api
with:
name: arquisoft/lomap_0/webapp
name: arquisoft/lomap_en2a/webapp
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_PUSH_TOKEN }}
registry: ghcr.io
Expand All @@ -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_en2a/restapi
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_PUSH_TOKEN }}
registry: ghcr.io
Expand All @@ -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_en2a/master/docker-compose-deploy.yml -O docker-compose.yml
# docker-compose stop
# docker-compose rm -f
# docker-compose pull
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# lomap_0
# lomap_en2a

[![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_en2a/workflows/CI%20for%20LOMAP_EN2A/badge.svg)](https://github.com/arquisoft/lomap_en2a/actions)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_lomap_en2a&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Arquisoft_lomap_en2a)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_lomap_en2a&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Arquisoft_lomap_en2a)

<p float="left">
<img src="https://blog.wildix.com/wp-content/uploads/2020/06/react-logo.jpg" height="100">
Expand All @@ -16,7 +16,7 @@ This project is a basic example of website using **React** with **Typescript** a
## Quick start guide
<mark>In case you already have node.js and npm, make sure you update them before attempting to build the images</mark>

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_en2a`. The fastest way to launch everything is with docker:
```bash
docker-compose up --build
```
Expand Down Expand Up @@ -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_en2a/tree/master/docs
- Webapp: https://github.com/arquisoft/lomap_en2a/tree/master/webapp
- Restapi: https://github.com/arquisoft/lomap_en2a/tree/master/restapi


## Deployment
Expand Down Expand Up @@ -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_en2a/restapi:latest
ports:
- "5000:5000"
webapp:
image: ghcr.io/arquisoft/lomap_0/webapp:latest
image: ghcr.io/arquisoft/lomap_en2a/webapp:latest
ports:
- "3000:3000"
depends_on:
Expand All @@ -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_en2a/master/docker-compose-deploy.yml -O docker-compose.yml
docker-compose stop
docker-compose rm -f
docker-compose pull
Expand Down
16 changes: 8 additions & 8 deletions README_es.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# lomap_0
# lomap_en2a

[![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_en2a/workflows/CI%20for%20LOMAP_EN2A/badge.svg)](https://github.com/arquisoft/lomap_en2a/actions)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_lomap_en2a&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Arquisoft_lomap_en2a)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_lomap_en2a&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Arquisoft_lomap_en2a)

<p float="left">
<img src="https://blog.wildix.com/wp-content/uploads/2020/06/react-logo.jpg" height="100">
Expand All @@ -16,7 +16,7 @@ Este proyecto es un ejemplo básico de un sitio web utilizando **React** con **T

<mark>Si tienes instalados node.js y npm, asegúrate de actualizarlos antes de intentar construir las imagenes</mark>

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_en2a`. La manera más rápida de ejecutar todo es con Docker.

```bash
docker-compose up --build
Expand Down Expand Up @@ -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_en2a/tree/master/docs
- Webapp: https://github.com/arquisoft/lomap_en2a/tree/master/webapp
- Restapi: https://github.com/arquisoft/lomap_en2a/tree/master/restapi
4 changes: 2 additions & 2 deletions docker-compose-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version: '3.5'
services:
restapi:
image: ghcr.io/arquisoft/lomap_0/restapi:latest
image: ghcr.io/arquisoft/lomap_en2a/restapi:latest
ports:
- "5000:5000"
webapp:
image: ghcr.io/arquisoft/lomap_0/webapp:latest
image: ghcr.io/arquisoft/lomap_en2a/webapp:latest
ports:
- "3000:3000"
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -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_en2a/](https://arquisoft.github.io/lomap_en2a/).

### 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:
Expand Down Expand Up @@ -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_en2a/](https://arquisoft.github.io/lomap_en2a/) 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.
4 changes: 2 additions & 2 deletions docs/README_es.md
Original file line number Diff line number Diff line change
@@ -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_en2a/](https://arquisoft.github.io/lomap_en2a/).

### 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:
Expand Down Expand Up @@ -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_en2a/](https://arquisoft.github.io/lomap_en2a/) 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.
2 changes: 1 addition & 1 deletion docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
// ====================================

= image:LogoASW.png[arc42] LOMAP_0
= image:LogoASW.png[arc42] LOMAP_EN2A
// toc-title definition MUST follow document title without blank line!
:toc: left
:toc-title: Table of Contents
Expand Down
2 changes: 1 addition & 1 deletion restapi/Dockerfile
Original file line number Diff line number Diff line change
@@ -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_en2a
COPY . /app
WORKDIR /app
#Install the dependencies
Expand Down
4 changes: 2 additions & 2 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sonar.organization=arquisoft
sonar.host.url=https://sonarcloud.io
sonar.projectKey=Arquisoft_lomap_0
sonar.projectKey=Arquisoft_lomap_en2a

sonar.language=ts
sonar.projectName=lomap_0
sonar.projectName=lomap_en2a
sonar.projectVersion=1.0.4

sonar.coverage.exclusions=**/*.test.tsx,**/*.test.ts
Expand Down
2 changes: 1 addition & 1 deletion webapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -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_en2a
COPY . /app
WORKDIR /app
#Install the dependencies
Expand Down
2 changes: 1 addition & 1 deletion webapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_en2a.yml](.github/workflow/lomap_en2a.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.

Expand Down
2 changes: 1 addition & 1 deletion webapp/README_es.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_en2a.yml](.github/workflows/lomap_en2a.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.

Expand Down
2 changes: 1 addition & 1 deletion webapp/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function App(): JSX.Element {
<Box component="div" sx={{ py: 2}}>This is a basic example of a React application using Typescript. You can add your email to the list filling the form below.</Box>
<EmailForm OnUserListChange={refreshUserList}/>
<UserList users={users}/>
<Link href="https://github.com/arquisoft/lomap_0">Source code</Link>
<Link href="https://github.com/arquisoft/lomap_en2a">Source code</Link>
</Container>
</>
);
Expand Down

0 comments on commit 85ee68a

Please sign in to comment.