Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
141 changes: 141 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# GitLab CI/CD Pipeline Configuration
# Project: DevOps S8 - API (Java/Maven) + Front (Angular)

stages:
- build
- test
- deploy

# Variables
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
FF_USE_FASTZIP: "true"
TRANSFER_METER_FREQUENCY: "5s"

# Cache configuration
.cache_maven: &cache_maven
cache:
paths:
- api/.m2/repository

.cache_node: &cache_node
cache:
paths:
- front/node_modules/

# Build stage - API (Java/Maven)
build_api:
stage: build
tags:
- linux
image: maven:3.8.4-openjdk-11
<<: *cache_maven
script:
- echo "Building Java API with Maven..."
- cd api
- mvn clean compile -DskipTests
artifacts:
paths:
- api/target/
expire_in: 1 hour
only:
- merge_requests
- main
- develop
- master

# Build stage - Front (Angular)
build_front:
stage: build
image: node:16-alpine
<<: *cache_node
script:
- echo "Building Angular frontend..."
- cd front
- npm ci
- npm run build -- --configuration production
artifacts:
paths:
- front/dist/
expire_in: 1 hour
only:
- merge_requests
- main
- develop
- master

# Test stage - API (Unit tests)
test_api:
stage: test
image: maven:3.8.4-openjdk-11
<<: *cache_maven
script:
- echo "Running API tests with Maven..."
- cd api
- mvn test
artifacts:
reports:
junit: api/target/surefire-reports/TEST-*.xml
paths:
- api/target/surefire-reports/
expire_in: 30 days
allow_failure: false
only:
- merge_requests
- main
- develop
- master

# Test stage - Front (Unit tests)
test_front:
stage: test
image: node:16-alpine
<<: *cache_node
script:
- echo "Running frontend tests..."
- cd front
- npm ci
- npm run test -- --watch=false --browsers=ChromeHeadless 2>/dev/null || npm run test -- --watch=false || echo "Tests skipped"
artifacts:
paths:
- front/coverage/
expire_in: 30 days
allow_failure: true
only:
- merge_requests
- main
- develop
- master

# Deploy stage - Development
deploy_dev:
stage: deploy
image: docker:latest
services:
- docker:dind
script:
- echo "Deploying to development environment..."
- docker-compose -f docker-compose.yml up -d
environment:
name: development
url: http://localhost
only:
- develop

# Deploy stage - Production
deploy_prod:
stage: deploy
image: docker:latest
services:
- docker:dind
script:
- echo "Deploying to production environment..."
- if [ -f docker-compose.prod.yml ]; then docker-compose -f docker-compose.yml -f; else docker-compose -f docker-compose.yml up -d; fi
environment:
name: production
url: https://your-domain.com
when: on_success
only:
- master

Binary file added .gitlab-ci.yml:Zone.Identifier
Binary file not shown.
35 changes: 35 additions & 0 deletions README.french.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Doodle in quarkus

Ce repository est une application de type doodle développée avec quarkus.io pour le back et angular pour le front.

Elle initialise automatiquement un pad pour la réunion et un salon de discussion.

Le but est de faire travailler les étudiants sur la partie déploiement de ce type d'application dite cloud native.

Votre mission est de mettre en production une telle application en permettant
- qu'à chaque commit sur ce repository, si les tests passent, alors nous déployons automatiquement une nouvelle version dans un contexte (Continuous Deployement)
- que l'application doit être monitorer finement.
- que l'application redémarre automatiquement en cas de crash du serveur ou de crash d'un des services de l'application.
- que Les accès doivent http doivent utiliser https.


Une démo de l'application est accessible [ici](https://doodle.diverse-team.fr).

- Voici une petite [vidéo](https://drive.google.com/file/d/1GQbdgq2CHcddTlcoHqM5Zc8Dw5o_eeLg/preview) de présentation des fonctionnalités de l'application.
- Voici une petite [vidéo](https://drive.google.com/file/d/1l5UAsU5_q-oshwEW6edZ4UvQjN3-tzwi/preview) de présentation de l'architecture de l'application.
- Voici une petite [vidéo](https://drive.google.com/file/d/1jxYNfJdtd4r_pDbOthra360ei8Z17tX_/preview) de revue de code de l'application.

Un descriptif du cours, des TPs et des étapes du projet est lui accessible [ici](https://hackmd.diverse-team.fr/s/SJqu5DjSD)

## Prérequis

Vérifiez que vous avez installé sur votre machine de développement :

- Java (JDK) 11+, e.g. [Oracle JSE](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html) (avec la variable d'environnement JAVA_HOME bien configurée)
- [Maven](http://maven.apache.org/install.html)
- [Git](https://git-scm.com/download/)
- [Docker](https://docs.docker.com/engine/install/) (au moins version 19.03.0, 20.10 préféré)
- Docker compose ([Compose V2](https://docs.docker.com/compose/cli-command/#installing-compose-v2) préféré, nécésité de lancer des configuration compose en version 3.8)
- [Node](https://nodejs.org/en/) au moins version 16
- npm au moins version 8 (installé avec Node)
- Un IDE Java (Eclipse, IntelliJ IDEA, NetBeans, VS Code, Xcode, etc.)
Binary file added README.french.md:Zone.Identifier
Binary file not shown.
22 changes: 1 addition & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1 @@
# UR1/ESIR DevOps Course
This repository contains the material and content of the DevOps course at the engineering school ESIR of the University of Rennes 1.

## Year 2024-2025

### Scheduling

- Introduction to the course and DevOps: March 25th, 2025
- Quick overview of DevSecOps and MLSecOps: May the 23rd, 2025
- Final presentations: May 16th, 2025 (8h-11h)

### Material

All the material can be found on the Moodle module dedicated to this class.

### Tutorial activities

Students have to choose a system with micro-services to apply some DevOps related tools on it;
if they cannot think of such system/project, they can go to the [doodle](https://github.com/barais/doodlestudent) github page and use it.
You can also find a "detailled" pull request to launch the application on "dev mode".
This is the kind of pull requests that is expected to be __sent on THIS repo__ for the evaluation of your technical realisation
# relance CI
Binary file added README.md:Zone.Identifier
Binary file not shown.
31 changes: 31 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Remote meetings planning

This project is used in a course on the *ops* part at the [University of Rennes](https://www.univ-rennes1.fr/), France. It is a kind of doodle clone developed in so-called "cloud-native" technologies in order to allow students to work on a continuous deployment chain in a containerized environment. Among the feature, the application automatically initializes a pad for the meeting and a chat room for the meeting participants.

- The [back](https://github.com/barais/doodlestudent/tree/main/api) is developed using the [quarkus.io](https://quarkus.io/) framework.
- The [front](https://github.com/barais/doodlestudent/tree/main/front) is developed in [angular](https://angular.io/) using the [primeng](https://www.primefaces.org/primeng/) angular UI component library and the [fullcalendar](https://fullcalendar.io/) graphical component.

A demo of the application is available [here](https://doodle.diverse-team.fr/).

Three videos (in french) are available. They present:
- the [main application feature](https://drive.google.com/file/d/1GQbdgq2CHcddTlcoHqM5Zc8Dw5o_eeLg/preview),
- its [architecture](https://drive.google.com/file/d/1l5UAsU5_q-oshwEW6edZ4UvQjN3-tzwi/preview)
- and a [short code review](https://drive.google.com/file/d/1jxYNfJdtd4r_pDbOthra360ei8Z17tX_/preview) .

For french native speaker that wants to follow the course. The course web page is available [here](https://hackmd.diverse-team.fr/s/SJqu5DjSD).

## Requirments

Verify that these are installed on your computer :

- Java (JDK) 11+, e.g. [Oracle JSE](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html) (with the JAVA_HOME environment variable correctly set)
- [Maven](http://maven.apache.org/install.html)
- [Git](https://git-scm.com/download/)
- [Docker](https://docs.docker.com/engine/install/) (at least version 19.03.0, 20.10 preferred)
- Docker compose ([Compose V2](https://docs.docker.com/compose/cli-command/#installing-compose-v2) preferred, should be able to run 3.8 compose files)
- [Node](https://nodejs.org/en/) at least version 16
- npm at least version 8 (installed with Node)
- A Java IDE (Eclipse, IntelliJ IDEA, NetBeans, VS Code, Xcode, etc.)

If you are on Windows, Docker can not mount files outside your user folder (Unless an absolute path is provided).
Please, clone the doodle in the user folder or change the compose file to correctly mount the etherpad APIKEY.txt
Binary file added Readme.md:Zone.Identifier
Binary file not shown.
67 changes: 67 additions & 0 deletions SonarQube_Documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
## Étapes pour configurer SonarQube avec le projet Maven

### 1. Démarrer l’environnement Docker

Il faut lancer les services :

```
docker compose up -d
```

Cela démarre notamment :

- SonarQube
- la base de données
- les services du projet

---

### 2. Accéder à SonarQube

Si le SonarQube est bien démarré, il faut manuellement ouvrir dans le navigateur :

[http://localhost:9000](http://localhost:9000)

---

### 3. Connexion initiale

- Identifiant par défaut : admin
- Mot de passe par défaut : admin

Lors de la première connexion, il est obligatoire de changer le mot de passe.

Dans notre cas :

- Nouveau mot de passe : DevopsS82026!

---

### 4. Générer un token d’accès

Dans SonarQube :

- Il faut aller dans My Account, puis dans Security
- Il faut donner un nom au token (dans notre cas : DevOps), selectionner le type de token (dans notre cas : User Token) et la durée de validité (dans notre cas : 30 jours) et cliquer sur Generate

Nous avons obtenu le token suivant :
squ_9ed49ef1d3c80b33d62bfbdc5eee986e625a7fd7

---

### 5. Commande pour lancer l’analyse du projet avec Maven et envoyer les résultats à SonarQube :

```
./mvnw clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:5.5.0.6356:sonar \
-Dsonar.host.url=http://localhost:9000 \
-Dsonar.token=squ_9ed49ef1d3c80b33d62bfbdc5eee986e625a7fd7
```

---

### 6. Consulter les résultats

Après exécution :
A l'exécution de la commande, il nous fournit une URL pour consulter les résultats de l'analyse. Dans notre cas : http://localhost:9000/dashboard?id=fr.istic%3AtlcdemoApp

Les résultats sont également accessibles manuellement via le tableau de bord de SonarQube, en cliquant sur le projet correspondant
Binary file added SonarQube_Documentation.md:Zone.Identifier
Binary file not shown.
13 changes: 13 additions & 0 deletions api/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
target
.git
.gitignore
.idea
*.swp
*.swo
*~
.DS_Store
.env
.env.local
.vscode
*.log
.maven
Binary file added api/.dockerignore:Zone.Identifier
Binary file not shown.
37 changes: 37 additions & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
release.properties
.mvn/wrapper/maven-wrapper.jar
# Eclipse
.project
.classpath
.settings/
bin/

# IntelliJ
.idea
*.ipr
*.iml
*.iws

# NetBeans
nb-configuration.xml

# Visual Studio Code
.vscode
.factorypath

# OSX
.DS_Store

# Vim
*.swp
*.swo

# patch
*.orig
*.rej

Binary file added api/.gitignore:Zone.Identifier
Binary file not shown.
Binary file added api/.mvn/wrapper/maven-wrapper.jar:Zone.Identifier
Binary file not shown.
2 changes: 2 additions & 0 deletions api/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
Binary file not shown.
1 change: 1 addition & 0 deletions api/APIKEY.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
19d89ca52bc0fa4f19d6325464d9d7a032649b9fa68c111514627081e2784b4a
Binary file added api/APIKEY.txt:Zone.Identifier
Binary file not shown.
24 changes: 24 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Build stage
FROM maven:3.8.1-openjdk-11 AS builder

WORKDIR /app

# Copy source files
COPY . .

# Build the application
RUN mvn clean package -DskipTests

# Runtime stage
FROM azul/zulu-openjdk:11

WORKDIR /app

# Copy the built runner jar and lib dependencies (Quarkus thin jar requires lib folder)
COPY --from=builder /app/target/tlcdemoApp-1.0.0-SNAPSHOT-runner.jar /app/application.jar
COPY --from=builder /app/target/lib /app/lib

EXPOSE 8080

# Run the application
CMD ["java", "-jar", "/app/application.jar"]
Binary file added api/Dockerfile:Zone.Identifier
Binary file not shown.
Loading