Setting up Continuous Integration

Setting up Continuous Integration (CI) for a JHipster application is harder than for a classic typical Spring MVC application because of the complexity associated with maintaining a build composed of 2 software stacks:

  • the Java back-end code with Maven or Gradle
  • the JavaScript front-end with NodeJS, NPM and Gulp

Each stack comes with its own dependency management (Maven artifacts, NPM packages) with potential conflicts to solve.

JHipster should support the following CI systems out of the box:

Running the sub-generator

To generate these config files, run this command in your project folder:

yo jhipster:ci-cd

Then answer all the questions.

What CI/CD pipeline do you want to generate ?

The CI/CD pipeline you want to generate:

  • Jenkins pipeline
  • Travis CI
  • GitLab CI
  • CircleCI

Jenkins pipeline: what tasks/integrations do you want to include ?

The tasks/integrations you want to include in the Jenkins pipeline:

  • Perform the build in a Docker container
  • Analyze code with Sonar
  • Send build status to Gitlab

What is the name of the Sonar server ?

Choose the name of the Sonar server.

In GitLab CI perform the build in a docker container (hint: uses docker container)?

If you use a private GitLab CI, you can use directly the runners.

If you use official pipeline, you need to use Docker container.

Deploy to Heroku?

  • In Jenkins pipeline
  • In GitLab CI
  • In CircleCI

You have to add the HEROKU_API_KEY environment variable.