Skip to content
Snippets Groups Projects
To learn more about this project, read the wiki.
README.md 13.09 KiB

VitamUI

Prerequisites

Tools

  • Install JDK version >= 8
  • Install Maven
  • Install Git
  • Install Node.js and npm (with nvm)
    • Configure default registry: npm config set registry https://registry.npmjs.org/
  • Python version 2.7 + pip for Python 2
  • Install Ansible (see Ansible)

Ansible

Current version of VitamUI depends on Ansible version 2.7.0 in order to run installation scripts.

With VirtualEnv

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: vitamUI-ansible/bin/activate

Without VirtualEnv

  • First remove older versions of Ansible before re-installing it: pip uninstall ansible.
  • Si une version d'ansible à été installée via apt-get install, il est nécessaire de la désinstaller : apt-get remove ansible

Common steps

  • Install Ansible 2.7.0: pip install ansible==2.7.0
  • Check the version of ansible: ansible --version

Il est possible que l'ajout du lien vers ansible dans le PATH et/ou qu'un redémarage soit nécessaire

Configuration

  • Clone project and change ownership: sudo chown -R $USER vitam-ui/
  • Build project using the "right" profile (see Maven profiles and Build)

For Vitam internal developers

  • Build project using vitam profile (see Build for Vitam developers )
  • Set up environment variables : SERVICE_NEXUS_URL and SERVICE_REPOSITORY_URL
  • Copy files: access-external-client.conf, ingest-external-client.conf, keystore_ihm-demo.p12 and truststore_ihm-demo.jks into api/api-(iam|referential)/(iam|referential)-internal/src/main/config/dev-vitam/
  • Redirect dev.vitamui.com URL defined in code to localhost : add this line 127.0.0.1 dev.vitamui.com to your hosts (/etc/hosts) file

For non Vitam developers

Common errors

/bin/sh: 1: /usr/bin/python: not found => Create symlink, for instance: sudo ln -s /usr/bin/python2.7 /usr/bin/python

Maven profiles

Without a profile, only Java projects are build.

Global Maven profiles

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 built 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 built 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 information.

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

This is the 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 environment 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

Build (first build) // DEPRECATED?

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 for Vitam internal developers

mvn clean install [-Ddependency-check.skip=true] -Denv.SERVICE_NEXUS_URL=... -Denv.SERVICE_REPOSITORY_URL=... [-DskipTests] -Pvitam

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 prod 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.

Build with integration tests for development environment

Use the dev-it 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.

Build with integration tests for Jenkins