/generator-jhipster-debian-packager

JHipster module to package a JHipster application into a debian/ubuntu .deb package

Primary LanguageJavaScriptOtherNOASSERTION

generator-jhipster-debian-packager

NPM version Build Status Dependency Status

JHipster module, packages a JHipster application into a debian/ubuntu .deb package

Introduction

This is a JHipster module, that is meant to be used in a JHipster application. The module uses the jdeb library to repackage the war and configuration files into a .deb archive

Prerequisites

As this is a JHipster module, we expect you have JHipster and its related tools already installed:

Installation

To install this module:

npm install -g generator-jhipster-debian-packager

To update this module:

npm update -g generator-jhipster-debian-packager

Usage

In your JHipster project directory run:

yo jhipster-debian-packager

This will add a jdeb goal to the pom.xml and support files that will create a .deb archive in the target directory when mvn package is called. Options :

  • --force if you don't want questions to be asked.
  • --clean to uninstall the module instead of installing.

NOTE: with the current version of JHipster, some modifications must be done manually in the pom.xml:

  • upgrade Spring Boot version to 1.3.2.RELEASE (because of issue spring-projects/spring-boot#4866)
  • with JHipster version <= 2.26.2, set the war as executable for the prod profile with <executable>true</executable>

You can then use the command

dpkg-i target/myapp_0.0.1~SNAPSHOT_all.deb

to install the package on a debian or ubuntu server. Or you can deploy it to an apt repository.

The executable war will be installed and started as a linux service. To start it manually use:

sudo service <appname> start

By default, the application is started with the prod profile. This can be changed in the /etc/default/<appname> configuration file.

The package installs the following files:

  • /usr/share/<appname>/lib/<appname>-<version>.war: your JHipster application as executable war symlinked to /usr/share/<appname>/bin/<appname>
  • /etc/default/<appname>: the launch script configuration file (see Spring Boot doc. The .conf file is symlinked to this file)
  • /etc/<appname>/: the directory for the configuration files (application.yml, ...)
  • /var/log/<appname>/ : the directory for the application logs

License

Apache-2.0 © [Christophe Bornet]