Build and deploy Debian package
The Maven template for a new application automatically includes plugins for building a Debian package (*.deb
) and uploading the package to an APT repository. Through this process, a TopLogic application can be installed, run, and especially updated "one-click" in an Ubuntu system.
POM settings
The following settings must be made in the pom.xml
of the new application to prepare the release process:
<tl.deb.skipDeploy>false</tl.deb.skipDeploy>
<tl.deb.repositoryUrl>https://my.server/nexus/repository/my-deb</tl.deb.repositoryUrl>
<tl.deb.serverId>my-server</tl.deb.serverId>
An installation of the Sonatype Nexus Repository Manager can be used as the APT repository. In this, APT repositories can be set up in addition to Maven repositories. The value tl.deb.repositoryUrl
can then be copied from the repository settings. Important: The '/' character at the end of the URL must be omitted, as this is automatically added by the Deploy plugin.
Also, a Maven release repository must be entered in the distributionManagement
section ("fill-out-here
" replace with a repository URL):
<distributionManagement>
<repository>
<id>my-releases</id>
<url>fill-out-here</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<snapshotRepository>
<id>my-snapshots</id>
<url>fill-out-here</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</snapshotRepository>
</distributionManagement>
If the application is only to be deployed to an APT repository, the maven.deploy.skip
property can alternatively be set to true
when deploying.
Deploy to APT repository
Once all settings are made, a normal deploy creates a DEB package in addition to the WAR file and uploads it to the configured APT repository:
mvn deploy
Ubuntu Install
The custom APT repository is made known to the system via a file /etc/apt/sources.list.d/my-repo.list
:
deb https://my.server/nexus/repository/my-repo/ toplogic main
If the APT repository requires credentials, these can be stored in /etc/apt/auth.conf.d/my-repo
:
machine my.server
login <user-name>
password <password>
Installation in the Ubuntu system can now be done via standard tooling:
apt-get install my-app
Update installation
After release of a new application version, it can be updated via apt
:
apt-get update
apt-get upgrade my-app
During the update process, a backup of the application's database and transaction data is made to the folder /root/
. If the update is not successful, the old status can be restored via this.