/codeship-jenkinsfile-spring

A springboot app built with a Jenkinsfile on codeship

Primary LanguageJava

Codeship running Jenkinsfiles

Building on the good work by Kohsuke for one shot execution of Jenkinsfiles, this shows how build a spring boot app with a Jenkinsfile on Codeship. For a more minimal example see: https://github.com/michaelneale/codeship-jenkinsfile

Codeship Status for michaelneale/codeship-jenkinsfile-spring

How to use

Clone this, do what you want. Customise the Dockerfile.build for build time dependencies and/or customise the base Jenkinsfile runner image as per instructions on https://github.com/kohsuke/jenkinsfile-runner/. Make sure to copy both codeship yml files, the Jenkinsfile and the Dockerfile.build into your project.

How it works

Codeship pro is native docker, so this works by launching the one shot Jenkins, after all the repository is copied into the container. The image used I pre-built with the current Jenkins LTS image and all the "recommended" plugins. If you need more plugins, at this point in time that means customising your own runner image.

The Jenkinsfile runs the build in the container defined by the Dockerfile.build (so there are some limitations for running on many nodes as one might do in a more complex Jenkinsfile). Obviously all the webhooks, pull requests, triggers and branches are handled by codeship. Jenkins is simply the execution engine.

The Dockerfile.build installs maven and defines the build environment for the app.

The codeship-steps.yml defines the script that launches the Jenkinsfile runner.