Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
bidof committed Feb 26, 2024
2 parents 7f9a8ee + 7e82bd2 commit 27a10ea
Show file tree
Hide file tree
Showing 10 changed files with 195 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ 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 users/authservice test -- --coverage
- run: npm --prefix users/userservice test -- --coverage
Expand Down
39 changes: 31 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Deploy on release

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

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


with:
name: arquisoft/wiq_es04c/webapp
username: ${{ github.actor }}
Expand Down Expand Up @@ -109,11 +113,29 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: gatewayservice
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

deploy:
name: Deploy over SSH
runs-on: ubuntu-latest
needs: [docker-push-userservice,docker-push-authservice,docker-push-gatewayservice,docker-push-webapp]
needs: [docker-push-userservice,docker-push-authservice,docker-push-gatewayservice,docker-push-webapp,docker-push-questionservice]
steps:
- name: Deploy over SSH
uses: fifsky/ssh-action@master
Expand All @@ -122,7 +144,8 @@ jobs:
user: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
command: |
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 down
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
docker compose --profile prod down
docker compose --profile prod up -d
Binary file added webapp/public/LogoSaberYGanar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 23 additions & 2 deletions webapp/src/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useState } from 'react';
import AddUser from './components/AddUser';
import Login from './components/Login';
import CssBaseline from '@mui/material/CssBaseline';
Expand All @@ -15,6 +15,7 @@ function App() {

return (
<Container component="main" maxWidth="xs">

<CssBaseline />
<Typography component="h1" variant="h5" align="center" sx={{ marginTop: 2 }}>
Welcome to the 2024 edition of the Software Architecture course
Expand All @@ -31,8 +32,28 @@ function App() {
</Link>
)}
</Typography>

</Container>
);
}

export default App;
export default App;

/*
import React from 'react';
import GenerateQuestion from './components/GenerateQuestion'; // Asegúrate de importar GenerateQuestion correctamente
import Login from './components/Login';
import CssBaseline from '@mui/material/CssBaseline';
import Container from '@mui/material/Container';
import Typography from '@mui/material/Typography';
import Footer from './components/Footer';
function App() {
return (
<Container component="main" maxWidth="xs">
<CssBaseline />
<Typography component="h1" variant="h5" align="center" sx={{ marginTop: 2 }}>
Welcome to the 2024 edition of the Software Architecture course
</Typography>
{ Aquí se muestra el componente GenerateQuestion */

2 changes: 1 addition & 1 deletion webapp/src/App.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import App from './App';

test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/Welcome to the 2024 edition of the Software Architecture course/i);
const linkElement = screen.getByText(/WIQ_ES04C/i);
expect(linkElement).toBeInTheDocument();
});
17 changes: 17 additions & 0 deletions webapp/src/components/Footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import '../styles/Footer.css'; // Asegúrate de importar tu archivo de estilos si es necesario

const Footer = () => (
<footer className="footer">
<p>Trabajo de Arquitectura del Software</p>
<p>
<a href="https://github.com/Arquisoft/wiq_es04c" target="_blank" rel="noopener noreferrer">
Github del Proyecto
</a>
</p>
<p>
<a href="https://ingenieriainformatica.uniovi.es" target="_blank"rel="noopener noreferrer">Escuela de Ingeniería Informática</a></p>
</footer>
);

export default Footer;
40 changes: 40 additions & 0 deletions webapp/src/components/NavBar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// En /src/components/Navbar.js
import React from 'react';
import '../styles/Navbar.css'; // Importa tu archivo de estilos si es necesario

const Navbar = () => (
<nav className="navbar navbar-expand-lg navbar-dark bg-primary fixed-top">
<div className="collapse navbar-collapse" id="my-navbarColor01">
<a className="navbar-brand" href="/">
<img src="/LogoSaberYganar.png" alt="Logo" />
</a>
{/*<ul className="navbar-nav mr-auto">
<li className="nav-item">
<a className="nav-link" href="/">
Home
</a>
</li>
</ul>*/}
</div>

<div className="collapse navbar-collapse" id="my-navbarColor02">
<ul className="navbar-nav justify-content-end">
<li className="nav-item">
<a className="nav-link" href="/signup">
<i className="fas fa-sign-in-alt" style={{ fontSize: '16px' }}></i>
<span>Registrarse</span>
</a>
</li>
<li className="nav-item">
<a className="nav-link" href="/login">
<i className="fas fa-sign-in-alt" style={{ fontSize: '16px' }}></i>
<span>Iniciar sesión</span>
</a>
</li>
</ul>
</div>
</nav>

);

export default Navbar;
8 changes: 7 additions & 1 deletion webapp/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

/*funcion q representa la barra de navegacion superior*/
import Footer from './components/Footer';
import Navbar from './components/NavBar';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<Navbar></Navbar>

<App />

<Footer></Footer>
</React.StrictMode>
);

Expand Down
26 changes: 26 additions & 0 deletions webapp/src/styles/Footer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* Estilo para el pie de página */
/* Estilos del pie de página */
.footer {
position: fixed;
bottom: 0;
width: 100%;
left:0%;
background-color: #001f3f;
color: #ffffff;
padding: 10px;
text-align: center;
display: flex;
justify-content: space-around; /* Distribuye los elementos horizontalmente */
align-items: center;
}

.footer a {
color: #ffffff; /* Enlaces en texto blanco */
text-decoration: none;

}

.footer a:hover {
text-decoration: underline; /* Subraya enlaces al pasar el ratón */
}

49 changes: 49 additions & 0 deletions webapp/src/styles/Navbar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* Estilo para la barra de navegación */
.navbar {
background-color: #001f3f; /* Fondo azul oscuro */
padding: 10px; /* Espaciado interno */
display: flex;
justify-content: space-between;
align-items: center;
}

/* Estilo para el logo */
.navbar-brand img {
width: 5em; /* Ancho del logo */
}

/* Estilo para la lista de navegación */
.navbar-nav {
display: flex;
align-items: center;
list-style-type: none; /* Eliminar el punto de los li para que no quede feo */
margin: 0; /* Eliminar el margen por defecto */
padding: 0; /* Eliminar el padding por defecto */
}

/* Estilo para los elementos de la lista de navegación */
.navbar-nav li {
margin-right: 1em; /* Espaciado entre elementos de la lista */
}

/* Estilo para los botones de login y registro */
.navbar-nav a {
color: #ffffff; /* Texto blanco */
text-decoration: none;
}

/* Estilo para hacer que la barra de navegación sea responsive en dispositivos móviles */
@media (max-width: 768px) {
.navbar {
flex-direction: column; /* Cambia a una columna en dispositivos móviles */
align-items: flex-start;
}

.navbar-nav {
margin-top: 10px; /* Espaciado superior en dispositivos móviles */
}

.navbar-nav li {
margin: 5px 0; /* Espaciado entre elementos de la lista en dispositivos móviles */
}
}

0 comments on commit 27a10ea

Please sign in to comment.