Skip to content
Snippets Groups Projects
  • Makhtar DIAGNE's avatar
    Java11 (#41) · d3ea578b
    Makhtar DIAGNE authored
    
    * [TECH] Nginx add referential apps
    
    * [TECH] Fix theme default logo
    
    * [TECH] Fixes from PR review
    
    * [TECH] Strange fixes for ui-referential (why was it working)
    
    * Update ui/ui-frontend/projects/identity/src/locale/messages.xlf
    
    Co-authored-by: default avatarCouzinieAtCines <62284459+CouzinieAtCines@users.noreply.github.com>
    
    * [TECH] Merge fixes
    
    * compilation works
    
    * it runs
    
    * fix login/pwd authentication
    
    * handle provided username
    
    * some refactoring
    
    * login/pwd + authn delegation works (with or without service)
    
    * surrogation works
    
    * change password is triggered when the user is already authenticated using the doChangePassword parameter
    
    * password management
    
    * final tests on surrogation
    
    * WIP MFA
    
    * MFA works
    
    * [TECH]  Update project from JAVA8 to JAVA11 with dependencies
    
    * [TECH] Remove unused jks files in integration data
    
    * fix back links
    
    * don't lost surrogation when bad password
    
    * [TECH] CAS set metrics dependency for prometheus
    
    * clean Spring config and open management endpoints
    
    * fix surrogation lost on bad password
    
    * [TECH] Configure Prometheus for SpringBoot services
    
    * [TECH] Use smtp4dev in our dev environment
    
    * [TECH] RPM update jdk from 1.8 to 11
    
    * [DEVOPS] Fix unknown variable vitamui_services.x.dir.assets
    
    * [DEVOPS] Update scripts for deployment
    
    * [DLAB-3453] Update operation in order to extend it
    
    * [DLAB-3453] Remove priority on OperationStatus
    
    * [US DLAB-3806] Add pdf generation with images[US DLAB-3806] Add TU on PDF generation
    
    * ⅜TECH] Fix merge deployment task
    
    * fix session hard timeout instead of idle timeout
    
    * upgrade to CAS v6.1.6 and pac4j v4.0.0
    
    * [TECH] CAS Security : add hostnameverifier optional property, activated by default
    
    * [devops] add validation of java 11
    
    * [DEVOPS] Fix vitam-ui dpeloyment
    
    * [WIP] Upgrade logstash config according to Java 11
    
    * [TECH] Update deployment
    
    * [TECH] Security / Authentification : Fix  token increment
    
    * [TECH] Fix deployment maven build
    
    * RABB-519: corrige l'erreur en cas de ticket expiré
    
    * [TECH] Remove compiler overloading in cas server pom
    
    * [DEVOPS] Improve mongo deployment
    
    * [TECH] Update nginx conf in order to view objects
    
    * [devops] add tags for service installation
    
    * [DEVOPS] Add vitamui uninstallation
    
    * [devops] put consul as vitam service
    
    * [TECH] Frontend : Some cleaning & optimization
    
    optimisation
    
    * [TECH] FIx ui frontend plugin & configuration
    
    * [TECH] Fix recette configuration
    
    * [TECH] CAS : Set default data for twilio account
    
    * [TECH] Fix deployment uninstall when file is absent
    
    * [TECH] Cas : fix war build with tomcat dependencies
    
    * [TECH] Fix ui frontend plugin and configuration (bis)
    
    * [TECH] CAS 6.1.6 : update static templates, js & add theming variables
    
    * [FIX RABB-579] Fix error sending mail from iam-internal
    
    * [TECH] Frontend use assets from ui-frontend-common & update branding
    
    * [FIX RABB-539] Handle redirections for CAS Authentication failure
    
    * [TECH] Frontend : add gzip compression
    
    * [TECH] Uninstall remove assets
    
    * [FIX RABB-555] Fix cas deployment config and password init for a new user
    
    * [TECH] Fix merge
    
    * [TECH] Fix merges
    
    * Update Jenkinsfile
    
    Changed label from "contrib" to "java11" for building purpose
    
    * Update Jenkinsfile
    
    * fix cas-server dependencies, styles ui-ref, deployment archive
    
    * fix test iam-internal
    
    * redo tar.gz
    
    * zip deployment
    
    * add prod profile for frontend
    
    * fix maven-assembly-plugin version and webpack profile
    
    * Try generating zip package archive
    
    Co-authored-by: default avatarMakhtar DIAGNE <makhtar.diagne@teamdlab.com>
    Co-authored-by: default avatarCouzinieAtCines <62284459+CouzinieAtCines@users.noreply.github.com>
    Co-authored-by: default avatarJérôme LELEU <jerome.leleu@teamdlab.com>
    Co-authored-by: default avatarMathieu Leguay <mathieu.leguay@teamdlab.com>
    Co-authored-by: default avatarFranck Bebel <franck.bebel@ouidou.fr>
    Co-authored-by: default avatardeviller <burma@free.fr>
    Co-authored-by: default avatarThierry Devillechabrolle <60743409+TDevillechabrolle@users.noreply.github.com>
    Co-authored-by: default avatarapp-jenkins <romain.gordolo@xelians.fr>
    Co-authored-by: default avatarGaëlle FOURNIER <gaelle.fournier.work@gmail.com>
    Unverified
    d3ea578b

VitamUI

VitamUI project.

Prerequisites

  • Install Java at least version 8
  • Install Maven
  • Install Git
  • Install NodeJs
  • Configure default registry: npm config set registry https://registry.npmjs.org/
  • Environment variable :
    • Vitam developer
      • Specify the environment variables : SERVICE_NEXUS_URL and SERVICE_REPOSITORY_URL
      • The maven command. Params between {} are optional: mvn clean install {-Ddependency-check.skip=true} -Denv.SERVICE_NEXUS_URL=... -Denv.SERVICE_REPOSITORY_URL=... {-DskipTests} -Pvitam
    • Non vitam developer

Clone

Execute this command to clone the project from the bitbucket repo:

git clone https://github.com/vitam-prg/vitamUI.git

Global Maven profiles

Without a profile, only Java projects are build. In order to build and package UI projects (i.e. Java backend & Angular frontend altogether), we use the plugin frontend-maven-plugin provided by com.github.eirslett.

dev

This profile is used to build the entire project for dev purposes, backend & frontend included.

  • UI modules are packaged with both Java & Angular.
  • Angular projects are build without optimization in order to reduce global build time.
  • Jasmine Karma tests are launched with the headless chrome.

prod

This profile is used to build the entire project for prod purposes, backend/frontend included.

  • UI modules are packaged with both Java & Angular.
  • Angular projects are build with optimization.
  • Jasmine Karma tests are launched with the headless chrome.

npm-publish

This profile is used to build, test & push npm packages to the npm repository.

  • It should be used in ui/ui-frontend-common to push the npm package of the common UI library.

rpm

This profile is used to build rpm packages. Only Maven modules with rpm.skip = false in their properties are eligible.

rpm-publish

This profile is used to push the generated rpm package. Only Maven modules with rpm.skip = false in their properties are eligible.

skipTestsRun

This profile is automatically activated if the option -DskipTests is used during Maven execution in order to disable Jasmine Karma tests execution.

sonar

This profile is used to update sonar informations.

webpack

This profile is used to build the entire project, backend & frontend included.

  • Angular projects are build without optimization in order to reduce global build time.
  • Jasmine Karma tests are launched with the headless chrome.
  • Jenkins can use this profile.

swagger

This profile is used to generate the swagger.json draft file for swagger documentation. It's only needed for API modules.

swagger-docs

This profile is used to generate .html & .pdf swagger documentation in tools/swagger/docs/.

  • Only Maven modules with 'rpm.skip = false' in their properties are eligible.

vitam

Profile to use for all Vitam internal developers

Integration Tests Maven profiles

No integration test is launched during the “normal” build of the project. Integration tests need a full running environnement in order to launch API tests & few UI tests also.

integration

This profile should be used to launch integration tests in Jenkins. The configuration used for the tests is available in integration-tests/src/test/resources/application-integration.yml

dev-it

This profile should be used to launch integration tests in our development environment. The configuration used for the tests is available in integration-tests/src/test/resources/application-dev.yml

iam

This profile should be used to launch API IAM integration tests in our development environment. The configuration used for the tests is available in integration-tests/src/test/resources/application-dev.yml

security

This profile should be used to launch API Security integration tests in our development environment. The configuration used for the tests is available in integration-tests/src/test/resources/application-dev.yml

front

This profile should be used to launch UI integration tests in our development environment. The configuration used for the tests is available in integration-tests/src/test/resources/application-dev.yml

Build (first build)

Publish ui-frontend-common package. It's needed for angular projects ui-portal & ui-identity to compile. Execute this command to build the project with unit tests and without building our angular projects:

cd ui/ui-frontend-common;
mvn clean install -Pnpm-publish

Build (only Java)

Execute this command to build the project with unit tests and without building our angular projects:

mvn clean install

Build (only Java) without test

Execute this command to build the project without unit tests and without building our angular projects:

mvn clean install -DskipTests

Build with IHM (JS) in dev mode

Use the dev maven profile to build the project with our angular projects. For our angular projects, the build doesn't generate the sourcemap and doesn't optimize the build. For the karma tests, we don't generate the code coverage and use the headless chrome.

mvn clean install -Pdev

Build with IHM (JS) for our Jenkins

Use the webpack maven profile to build the project with our angular projects. For our angular projects, the build generate the sourcemap and doesn't optimize the build. For the karma tests, we don't generate the code coverage and use the headless chrome.

mvn clean install -Pwebpack

Build with IHM (JS) for our Production environment

Use the webpack maven profile to build the project with our angular projects. For our angular projects, the build generate the sourcemap and optimize the build. For the karma tests, we don't generate the code coverage and use the headless chrome.

mvn clean install -Pprod

If -DskipTests id added during the build of dev, webpack or prod, unit tests and karma tests are both ignored.

Integration tests

Use the integration-tests maven profile to build the project with unit tests and integration tests

mvn clean verify -Pdev-it

For more details see README in integration-tests module.

Package to RPM

Use the RPM maven profile to build the project and package to RPM:

mvn clean package -Prpm,webpack

Execute Integration tests

mvn clean verify -Pintegration

Execute sonar report

mvn clean verify -Psonar

You can specify properties to change URL and login to sonar:

mvn clean verify -Psonar \
    -Dsonar.host.url=http://localhost:9000 \
    -Dsonar.login=<TOKEN AUTHENTICATION>

Deploy artifact

To build all artifacts and deploy to NEXUS use:

mvn clean deploy -Prpm,webpack

Swagger

To generate swagger.json use:

mvn test -Pswagger

To edit swagger.json you can use this website:

https://editor.swagger.io/

To generate index.pdf and index.html from swagger.json:

 mvn generate-resources -Pswagger-docs

Lancement de VITAMUI des versions

Current version of VITAMUI depends on Ansible version 2.7.0.

In order not to interfere with more recent Ansible version, deploy a Python VirtualEnv in which you install Ansible 2.7.0:

  • Check that VirtualEnv executable is installed: apt-get install python-virtualenv
  • In a directory of your choice, create the virtual environment: virtualenv vitamUI-ansible
  • Activate the environment . virtamUI-ansible/bin/activate
  • Install Ansible 2.7.0: pip install ansible==2.7.0
  • Check the version of ansible: ansible --version

Autre possibilité, Ansible version 2.7.0 doit être installé pour lancer le script mongo:

  • Si une version d'ansible à été installé via apt-get install, il est nécessaire de la sésinstaller apt-get remove ansible
  • Installer pip apt-get install -y python-pip
  • Installer ansible via pip pip install ansible==2.7.0
  • Vérifier que l'installation c'est bien déroulée ansible --version
  • Il est possible que l'ajout du lien vers ansible dans le PATH et/ou qu'un redémarage soit nécessaire

1 - Démarrage du Mongo VITAMUI

├── tools
│   ├── docker
│   │   ├── mongo: './restart_dev.sh'

### 2 - Démarrage du docker smpt4dev

├── tools │   ├── docker │   │   ├── mail: './start.sh'


### 3 - Lancement de l'application SpringBoot Security-Internal

│   ├── api-security │   │   ├── security-internal: 'mvn clean spring-boot:run' ou './run.sh'


### 4 - Lancement de l'application SpringBoot IAM-Internal

├── api │   ├── api-iam │   │   ├── iam-internal: 'mvn clean spring-boot:run' ou './run.sh'


### 5 - Lancement de l'application SpringBoot IAM-External

├── api │   ├── api-iam │   │   ├── iam-external: 'mvn clean spring-boot:run' ou './run.sh'


### 6 - Lancement de l'application CAS Server. La surcharge faite sur CAS nous empêche de lancer avec le plugin spring-boot

**CAS-Server dépend de security-internal, iam-internal & iam-external**

├── cas │   ├── cas-server: './run.sh'


## Scénario 1 : utilisation en dev

### 7a - Lancement de l'application SpringBoot correspondant au back de UI-Portal

└── ui └── ui-portal: 'mvn clean spring-boot:run'


### 7b - Lancement de l'application Angular UI-Portal

└── ui ├── ui-frontend: 'npm run start:portal'


### 8a - Lancement de l'application SpringBoot correspondant au back de UI-Identity

└── ui └── ui-identity: 'mvn clean spring-boot:run'


### 8b - Lancement de l'application Angular UI-Identity

└── ui ├── ui-frontend: 'npm run start:identity'


## Scénario 2 : utilisation en mode recette : Une compilation avec `-Pwebpack` a été effectuée.
**Attention les JAR doivent contenir les pages et scripts de la partie UI Frontend généré avec ng build.**


### 7 - Lancement de l'application SpringBoot correspondant au back de UI-Portal

└── ui └── ui-portal: './run.sh'


### 8 - Lancement de l'application SpringBoot correspondant au back de UI-Identity

└── ui └── ui-identity : './run.sh'


### 9. Les certificats sont auso-signés, il faut accepter les certificats dans le navigateur pour :

**Attention : sans cette étape, le logout sur toutes les applications par CAS ne fonctionne pas**

UI-Frontend

* https://dev.vitamui.com:4200

* https://dev.vitamui.com:4201/user

Ui-Back

* https://dev.vitamui.com:9000/

* https://dev.vitamui.com:9001/

### 10. Se connecter sur le portail via
* https://dev.vitamui.com:4200

### 11. Se connecter sur la page de réception des mails smpt4dev via
* http://localhost:3000/