Skip to content

Commit

Permalink
Merge pull request #60 from Arquisoft/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
bidof committed Mar 7, 2024
2 parents 30a2e23 + e17dba7 commit 3a6ff54
Show file tree
Hide file tree
Showing 78 changed files with 7,372 additions and 1,221 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
teamname="wiq_es04c"
teamname="wiq_es04c"
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- master
- releases
pull_request:
types: [opened, synchronize, reopened]
jobs:
Expand All @@ -18,8 +19,8 @@ jobs:
- run: npm --prefix users/authservice ci
- run: npm --prefix users/userservice ci
- run: npm --prefix gatewayservice ci
- run: npm --prefix questionsservice ci # Agrega la tarea para questionsservice
- run: npm --prefix webapp ci
- run: npm --prefix questionservice ci
- run: npm --prefix users/authservice test -- --coverage
- run: npm --prefix users/userservice test -- --coverage
- run: npm --prefix gatewayservice test -- --coverage
Expand Down
59 changes: 28 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Deploy on release

on:
push:
branches:
-master
-releases
release:
types: [published]

jobs:
unit-tests:
Expand Down Expand Up @@ -53,16 +51,34 @@ jobs:
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
env:
API_URI: http://${{ secrets.DEPLOY_HOST || 'localhost' }}:8000


API_URI: http://${{ secrets.DEPLOY_HOST }}:8000
with:
name: arquisoft/wiq_es04c/webapp
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: webapp
buildargs: API_URI
docker-push-questionservice:
name: Push question service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es04c/questionservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: ./questionservice



docker-push-authservice:
name: Push auth service Docker Image to GitHub Packages
runs-on: ubuntu-latest
Expand Down Expand Up @@ -113,29 +129,11 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: ./gatewayservice
docker-push-questionservice:
name: Push question service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es04c/questionservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: ./questionservice

workdir: gatewayservice
deploy:
name: Deploy over SSH
runs-on: ubuntu-latest
needs: [docker-push-userservice,docker-push-authservice,docker-push-gatewayservice,docker-push-webapp,docker-push-questionservice]
needs: [docker-push-userservice,docker-push-authservice,docker-push-gatewayservice,docker-push-webapp]
steps:
- name: Deploy over SSH
uses: fifsky/ssh-action@master
Expand All @@ -144,8 +142,7 @@ jobs:
user: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
command: |
wget https://raw.githubusercontent.com/arquisoft/wiq_es04c/releases/docker-compose.yml -O docker-compose.yml
wget https://raw.githubusercontent.com/arquisoft/wiq_es04c/releases/.env -O .env
git clone -b releases https://github.com/Arquisoft/wiq_es04c.git
wget https://raw.githubusercontent.com/arquisoft/wiq_es04c/master/docker-compose.yml -O docker-compose.yml
wget https://raw.githubusercontent.com/arquisoft/wiq_es04c/master/.env -O .env
docker compose --profile prod down
docker compose --profile prod up -d
docker compose --profile prod up -d
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
coverage
docs/build
.idea/
.vscode
.idea/
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "interactive"
"asciidoc.antora.enableAntoraSupport": true
}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# wiq_es04c

No hacer secciones nivel 0 (con solo un '=') porque no compila.
Ejemplo: no poner '= Requisitos de Calidad', sino '== Requisitos de Calidad'
No quitar el [[section-x]] del principio de un .adoc, porque si no no sale numerado.
Ejemplo: 12_glossary.adoc -> no quitar [[section-glossary]]

[![Deploy on release](https://github.com/Arquisoft/wiq_es04c/actions/workflows/release.yml/badge.svg)](https://github.com/Arquisoft/wiq_es04c/actions/workflows/release.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_wiq_es04c&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Arquisoft_wiq_es04c)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Arquisoft_wiq_es04c&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Arquisoft_wiq_es04c)
Expand Down
14 changes: 14 additions & 0 deletions api_interfaces/api_questionservice.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
petición HTTP GET getquestion
devuelve json -> {question: string, answers: answer[]}

-------------------------------------------
answer: {answer: string, correct: boolean}

EJEMPLO
const example_data = {question: 'pregunta ejemplo', respuesta: [
{answer: 'respuesta correcta', correct: true},
{answer: 'respuesta incorrecta1', correct: false},
{answer: 'respuesta incorrecta2', correct: false},
{answer: 'respuesta incorrecta3', correct: false}],
questionCategory: 'geografia'
};
64 changes: 49 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
mongodb:
container_name: mongodb-${teamname:-wiq_0}
container_name: mongodb-${teamname:-wiq_es04c}
image: mongo
profiles: ["dev", "prod"]
volumes:
Expand All @@ -10,10 +10,34 @@ services:
- "27017:27017"
networks:
- mynetwork
# Servicio de MySQL no se mete en el release te bajas la ultima imagen
questionservice-mysql:
image: mysql:latest
container_name: questionservice-mysql-${teamname:-wiq_es04c}
environment:
MYSQL_USER: bidof
MYSQL_PASSWORD: admin
MYSQL_ROOT_PASSWORD: admin
MYSQL_DATABASE: questions_db
MYSQL_CHARSET: utf8mb4
MYSQL_COLLATION: utf8mb4_unicode_ci
DB_PORT: 3306

ports:
- "3306:3306"
volumes:
- mysql-data:/var/lib/mysql
#montar en el directorio de mysql el archivo schema que esta en questionservice/database para que lo tenga el contendor y lo pueda ejecutar
#create_db es true
- ./questionservice/database/:/docker-entrypoint-initdb.d
networks:
- mynetwork
expose:
- "3306"

authservice:
container_name: authservice-${teamname:-wiq_0}
image: ghcr.io/arquisoft/${teamname:-wiq_0}/authservice:latest
container_name: authservice-${teamname:-wiq_es04c}
image: ghcr.io/arquisoft/${teamname:-wiq_es04c}/authservice:latest
profiles: ["dev", "prod"]
build: ./users/authservice
depends_on:
Expand All @@ -24,10 +48,10 @@ services:
- mynetwork
environment:
MONGODB_URI: mongodb://mongodb:27017/userdb

userservice:
container_name: userservice-${teamname:-wiq_0}
image: ghcr.io/arquisoft/${teamname:-wiq_0}/userservice:latest
container_name: userservice-${teamname:-wiq_es04c}
image: ghcr.io/arquisoft/${teamname:-wiq_es04c}/userservice:latest
profiles: ["dev", "prod"]
build: ./users/userservice
depends_on:
Expand All @@ -40,8 +64,8 @@ services:
MONGODB_URI: mongodb://mongodb:27017/userdb

gatewayservice:
container_name: gatewayservice-${teamname:-wiq_0}
image: ghcr.io/arquisoft/${teamname:-wiq_0}/gatewayservice:latest
container_name: gatewayservice-${teamname:-wiq_es04c}
image: ghcr.io/arquisoft/${teamname:-wiq_es04c}/gatewayservice:latest
profiles: ["dev", "prod"]
build: ./gatewayservice
depends_on:
Expand All @@ -57,27 +81,35 @@ services:
AUTH_SERVICE_URL: http://authservice:8002
USER_SERVICE_URL: http://userservice:8001


questionservice:
container_name: questionservice-${teamname:-wiq_0}
build: ./questionservice
container_name: questionservice-${teamname:-wiq_es04c}
build: questionservice
depends_on:
- questionservice-mysql
ports:
- "8003:8003"
networks:
- mynetwork

environment:
DB_HOST: questionservice-mysql


webapp:
container_name: webapp-${teamname:-wiq_0}
image: ghcr.io/arquisoft/${teamname:-wiq_0}/webapp:latest
container_name: webapp-${teamname:-wiq_es04c}
image: ghcr.io/arquisoft/${teamname:-wiq_es04c}/webapp:latest
profiles: ["dev", "prod"]
build: ./webapp
depends_on:
- gatewayservice
ports:
- "3000:3000"
environment:
- API_URI=${API_URI}

prometheus:
image: prom/prometheus
container_name: prometheus-${teamname:-wiq_0}
container_name: prometheus-${teamname:-wiq_es04c}
profiles: ["dev"]
networks:
- mynetwork
Expand All @@ -91,7 +123,7 @@ services:

grafana:
image: grafana/grafana
container_name: grafana-${teamname:-wiq_0}
container_name: grafana-${teamname:-wiq_es04c}
profiles: ["dev"]
networks:
- mynetwork
Expand All @@ -113,6 +145,8 @@ volumes:
mongodb_data:
prometheus_data:
grafana_data:
mysql-data:


networks:
mynetwork:
Expand Down
Binary file added docs/images/08_diagrama_modelo_dominio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/10_Arbol_de_calidad.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Building Block View.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Diagrama de contexto de negocio.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Diagrama de contexto técnico.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/Whitebox Overall System.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/bdLevel2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/diagrama_contexto_tecnico.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/loginLevel2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/uiLevel2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/whiteBoxGeneral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/whiteLevel1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 1 addition & 11 deletions docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// configure EN settings for asciidoc
include::src/config.adoc[]

= image:arc42-logo.png[arc42] Template
= image:arc42-logo.png[arc42] Generador de preguntas
:revnumber: 8.2 EN
:revdate: January 2023
:revremark: (based upon AsciiDoc version)
Expand Down Expand Up @@ -34,16 +34,6 @@ include::src/about-arc42.adoc[]
// horizontal line
***

[role="arc42help"]
****
[NOTE]
====
This version of the template contains some help and explanations.
It is used for familiarization with arc42 and the understanding of the concepts.
For documentation of your own system you use better the _plain_ version.
====
****


// numbering from here on
:numbered:
Expand Down
Loading

0 comments on commit 3a6ff54

Please sign in to comment.