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

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: gitlab.com uses docker container)?

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

If you use official gitlab.com 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 as environment variables.