Raging Goblin

13 June 2018

Move to Gitlab with a simple Java and Maven project

Filed under: Java — Raging Goblin @ 10:20
Tags: ,

I recently decided to move all my code from Github to Gitlab. Moving the repositories was a breeze due to the import function of Gitlab. There is one single feature however that I am missing from Github. Gitlab does not have a proper release page. It is on the backlog (41766) of Gitlab, but I am afraid that it might take a little while before it lands into Gitlab. Gitlab provides a different mechanism to release your code using a build pipeline based on Docker and using git tags.

For a very simple Java (with Maven) project however, I found this a bit intimidating and therefore I decided to write a short introduction to get you going. This is the simplest of the simplest beginnings and only serves as a starter. But from hereon you can enhance your own pipeline and there are plenty resources on the web to get you moving on. Only this first start was somehow lacking in my opinion.

As said, the build pipeline of Gitlab is based on Docker and to get you going you will need a runner. Luckily when you are on gitlab.com this is already taken care of by a couple of shared runners, so no need to worry about this. To kickoff your pipeline add a file named

.gitlab-ci.yml

to the root of your project. The simplest form of this yaml file can be:

image: maven:3-jdk-8-alpine

maven_build:
   script: "mvn package -B"
   artifacts:
      paths:
      - target/your build jar.jar

When you push this to Gitlab it will automatically kickoff a build for you at every commit.

A couple of things to note here. First, there is a reference to a Maven image. As the pipeline will use Docker, it will start a fresh container where Maven will not be available. So you need to tell the system to use an image that has Maven installed. You can find images at Docker hub. I just picked one with a Java 8 and a Maven 3 installation. The second thing to note is the build job I configured. The name (maven_build) does not matter, just pick one to your liking. The build command should be familiar to any Java developer, I just added the B flag so it will run without interruptions. At the end you will have to configure your artifacts. Otherwise, you will end up with artifacts only containing the sourcecode. You reference the jar which is normally available in the target directory. You can build your Maven project locally first to find out what your artifact will be named.

When you push this file you will find download buttons under CI/CD -> Jobs where you will be able to download your artifacts.

To further suit my needs I use a bit of an enhanced version of this configuration. E.g. I only build when I push a tag, otherwise I have to remove all the intermediate builds to prevent flooding the system with useless binaries. You can find an example here: MiWakeUpLight/.gitlab-ci.yml. Note that it is not possible to filter for a branch AND for a tag, the filtering is an OR filter (though a feature request exists).

For the rest everything is very well documented, but as a simple Java developer I had to adjust my workflow a bit to get me going on Gitlab.

Advertisements

MiWakeUpLight version 1.4 at Gitlab

Filed under: MiWakUpLight — Raging Goblin @ 08:19
Tags: , ,

Due to the recent acquisition of Github, I decided to move my code to Gitlab. MiWakeUplight is now at Gitlab: https://gitlab.com/raginggoblin/MiWakeUpLight.

3 February 2018

MiWakeUpLight version 1.3 released

Filed under: MiWakUpLight — Raging Goblin @ 12:15
Tags: ,

I released version 1.3 of MiWakeUpLight. My take on a wakeuplight using a Mi Light dual white lamp. I added a notification to show the next sunrise. You can checkout the project at https://github.com/raginggoblin/MiWakeUpLight.

6 January 2018

MiWakeUpLight version 1.2 released

Filed under: MiWakUpLight — Raging Goblin @ 21:58
Tags: ,

I released version 1.2 of MiWakeUpLight. My take on a wakeuplight using a Mi Light dual white lamp. I added the possibility to control the lamp directly from the web interface. You can checkout the project at https://github.com/raginggoblin/MiWakeUpLight.

AllSchedulesBootstrap

16 March 2017

MiWakeUpLight with WildFly Swarm

Filed under: Java,MiWakUpLight — Raging Goblin @ 21:11
Tags: , , , ,

Recently I wanted to find out if WildFly Swarm is a real challenger for Spring Boot. Rather than creating another ‘Hello World’ application I decided to convert a project I use on an ‘almost’ daily basis to a WildFly Swarm application. This way I could compare the two frameworks. I created a clone of https://github.com/raginggoblin/MiWakeUpLight with WildFly Swarm instead of Spring Boot. You can find this project on https://github.com/raginggoblin/MiWakeUpLightSwarm. So there you can find a WildFly Swarm project that contains all technologies you want in a full stack application, i.e. a database (H2), JPA, Hibernate, datasources, CDI, logging, configuration with yaml, EJB, JaxRS and a AngularJs frontend on top.

21 November 2016

OcNotes 1.2 released

Filed under: OcNotes — Raging Goblin @ 21:32
Tags: , ,

I released OcNotes version 1.2. You can now choose different colors for the sticky notes. I also implemented the systemtray from https://github.com/dorkbox/SystemTray This way it is better integrated with modern de’s like Gnome and Unity.

For more information see: https://raginggoblin.wordpress.com/ocnotes
For downloads see: https://github.com/raginggoblin/ocnotes

24 March 2015

OcNotes 1.1 released

Filed under: OcNotes — Raging Goblin @ 21:20
Tags: , ,

I released OcNotes version 1.1. It has some minor improvements. The delete button shows a trash icon and the fonts are configurable.

For more information see: https://raginggoblin.wordpress.com/ocnotes
For downloads see: https://github.com/raginggoblin/ocnotes

21 February 2015

Infolog turned to OcNotes

Filed under: OcNotes — Raging Goblin @ 20:02
Tags: , ,

Today I released OcNotes version 1.0. I moved from Egroupware to Owncloud and therefore had to rewrite my notes desktop client. I released it on Github today.

For more information see: https://raginggoblin.wordpress.com/ocnotes
For downloads see: https://github.com/raginggoblin/ocnotes

Create a free website or blog at WordPress.com.