• Stars
    star
    268
  • Rank 153,144 (Top 4 %)
  • Language
    Groovy
  • License
    Apache License 2.0
  • Created almost 10 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Self service Jenkins job generation using Jenkins Job DSL plugin groovy scripts. Reads .jervis.yml and generates a job in Jenkins.

Jervis: Jenkins as a service

Build Status Coverage Status Maven Central Release GH commits since latest release

  • Project status: released to maven central.
  • Currently Targeted platforms:
    • Jenkins server host: Linux and Mac OS X (Windows compatible)
    • Jobs on clients: Linux only (Multi-platform capable)
What is Jervis?

Documentation

The library API is also fully documented. To generate the latest developer docs execute the following command.

./gradlew groovydoc

The documentation can be found in build/docs/groovydoc.

Provided examples

More about Jervis

Jervis is a combination of some letters in the words Jenkins and Travis: JEnkins tRaVIS. Jenkins is a continuous integration tool which is typically installed on premises. Travis is a hosted, distributed continuous integration system used by many open source projects. Both Jenkins and Travis have paid and enterprise offerings.

Jervis uses Travis-like job generation using the Job DSL plugin and groovy scripts. It reads the .jervis.yml file of a project and generates a job in Jenkins based on it. If .jervis.yml doesn't exist then it will fall back to using the .travis.yml file.

For development planning and other documentation see the Jervis wiki. If you wish to stay up to date with the latest Jervis news then please feel free to watch this repository because I use the issue tracking and wiki for planning.

Why Jervis?

What is Jervis attempting to scale? Let's talk about some scale bottlenecks that have been overcome by Jenkins (formerly Hudson) and its community.

The scaling issue is a main bullet. The solution for the issue is in a sub-bullet.

  • Developers are challenged with integrating work, building often, and even deploying often.
    • Jenkins was invented.
  • Jenkins infrastructure is strained when too many agents are in one server and too many jobs are queued up on a daily basis. A single Jenkins server struggles to perform all requested builds in a timely manner. Jenkins also suffers from single point of failure as a lone server.
    • Multi-controller Jenkins was invented. This provides redundancy for the server. Throughput for daily build capacity is improved.
  • Jenkins jobs suffer from a lot of duplicate code. It is difficult to fix a bug in one job and have it propagate to other jobs.
    • Jenkins Job DSL plugin was invented. Configuration through code is now possible. Multiple jobs can be generated and regenerated with the same code using templates in a domain specific language.
  • Onboarding new projects in a Jenkins installation can be difficult. Typically engineers will get together and discuss the needs of the project and then configure a Jenkins job for the needs of the project. For enterprises with a very large number of projects it is typically hard to scale number of build engineers to match with the large number of projects which require onboarding into the build ecosystem.
    • Jervis is being invented. Job generation through convention over configuration. Scaling the onboarding for a project by creating and abiding by conventions in how jobs are generated. This is for large scale job generation and project onboarding. Jervis is taking lessons learned from a seasoned build engineer and attempting to fill this gap in the Jenkins ecosystem.

Set up

To include this library for use in your Job DSL plugin scripts you only need include it in your build tool.

Maven

<dependency>
  <groupId>net.gleske</groupId>
  <artifactId>jervis</artifactId>
  <version>2.0</version>
  <type>pom</type>
</dependency>

Gradle

Your Job DSL scripts should have a build.gradle file which has the following contents.

apply plugin: 'maven'

repositories {
    mavenCentral()
}


configurations {
    libs
}

dependencies {
    libs 'net.gleske:jervis:2.0'
    libs 'org.yaml:snakeyaml:2.0'
}

task cleanLibs(type: Delete) {
    delete 'lib'
}

task libs(type: Copy) {
    into 'lib'
    from configurations.libs
}

defaultTasks 'clean', 'libs'
clean.dependsOn cleanLibs

Then execute ./gradlew libs to assemble dependencies into the lib directory of the Jenkins workspace. Don't forget to add lib to the classpath. This must be done before you configure your Jenkins job to execute Job DSL scripts.

Interactive debugging

Groovy Console is built into the Gradle file.

./gradlew console

Other development commands

Generate code coverage reports.

./gradlew clean check jacocoTestReport

Build the jar file.

./gradlew clean jar

Sign build jars and sign archives.

./gradlew clean check signArchives

See also RELEASE.md.

Local SonarQube Analysis

See SonarQube README.

License

Copyright 2014-2023 Sam Gleske

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

jenkins-script-console-scripts

A repository of one-off script console scripts for Jenkins.
Groovy
443
star
2

jenkins-bootstrap-shared

Jenkins as immutable infrastructure made easy. A repository of shared scripts meant to be used as a git submodule. Packing Jenkins, plugins, and scripts into immutable packages and images.
Groovy
326
star
3

docker-compose-ha-consul-vault-ui

A docker-compose example of HA Consul + Vault + Vault UI
Shell
204
star
4

git-identity-manager

Git identity manager. It allows you to switch between git identities for user, name, and SSH private key used for authoring and publishing git commits.
Shell
93
star
5

jenkins-bootstrap-jervis

An automated Jenkins CI environment which provisions agent infrastructure on the fly per build.
Shell
75
star
6

nexus3-config-as-code

Configuration as code automation for Nexus Repository Manager v3.
Groovy
62
star
7

ekeyfinder

Archive of my sourceforge project Enchanted Keyfinder. Software key retrieval on Windows.
Pascal
61
star
8

jenkins-bootstrap-slack

Bootstrap a Jenkins instance configured for Jenkins slack plugin testing.
Groovy
41
star
9

docker-compose-lgsm-rust-dedicated-server

A dockerized LGSM dedicated server for the Facepunch game: Rust.
Shell
38
star
10

home

This is a git repository for my home directory - encryption and other helpful scripts
Scheme
34
star
11

demo-jenkins-world-2017

This repository is for a live demo of my Jenkins World 2017 presentation.
HTML
20
star
12

my_internal_ca

A set of basic scripts for managing an internal certificate authority.
Shell
19
star
13

drexel-university

This is a list of scripts I created while formerly working at Drexel University. These scripts were released with permission.
Shell
16
star
14

demo-jenkins-world-2018-jenkins-bootstrap

Groovy
8
star
15

docker-jenkins-jervis

Docker images for jervis.
Dockerfile
7
star
16

cloneable

A Java CLI utility which lists available GitHub repositories under a user or organization.
Groovy
7
star
17

sounds-of-endless-sky

Shell
5
star
18

terraria-dedicated-server

Scripts for running a Terraria dedicated server on Linux.
Shell
5
star
19

blog

A personal technical blog. Full featured complete with automated peer review.
HTML
5
star
20

endless-sky-vscode-devcontainer

Portable Development Environments for the Endless Sky community.
Dockerfile
4
star
21

docker-aws-tools

A quick start for AWS infrastructure development in a Dockerized dev environment.
Dockerfile
4
star
22

docker-zoom

Makefile
4
star
23

yml-install-files

A flexible YAML-based method of downloading multi-arch utilities with checksum validation. Intended for Docker.
Shell
4
star
24

docker-webhookrelay

A minimal sidecar container meant to run a webhook relay for a local docker service.
Dockerfile
3
star
25

docker-compose-nexus3-proxy

A local Nexus 3 proxy for my laptop whose purpose is to cache dependencies for docker containers and locally provisioned servers.
Shell
3
star
26

docker-production-ready-flask

This is an example app meant to package a Flask REST API in Docker meant for running in production contexts.
Makefile
3
star
27

docker-openvpn

My take on a minimal openvpn service
Shell
3
star
28

buildwine

Sometimes I need to build WINE from source. This repository keeps my notes.
Shell
3
star
29

consul-mysql

A MySQL relataional DB service backend using consul for service discovery.
Shell
2
star
30

endless-sky-disable-author-ships

An endless sky plugin to remove author ships from the game.
Shell
2
star
31

samrocketman.github.io

My personal website.
HTML
2
star
32

repository-secrets

A proof of concept for securing repository secrets for a build ecosystem where the repository is easily scrutinized by unauthorized parties.
Ruby
2
star
33

Spacefarer

Shell
2
star
34

github-backups

A simple set of scripts which helps me keep an offline backup of my GitHub work.
Ruby
2
star
35

vagrant-windows

Windows development machines on vagrant.
Ruby
2
star
36

consul-nexus3

A Nexus 3 service meant to be used with Consul service discovery.
Shell
2
star
37

servicenow-servicecatalog-exporter

Exports an entire ServiceCatalog from a ServiceNow instance.
Python
2
star
38

browser-detect.js

Archive of my sourceforge project to use JavaScript for detecting browsers and platforms.
JavaScript
1
star
39

software_password_design

An exploration in best practices for storing passwords in a database.
Python
1
star
40

example-mysql-live-migration

This repository serves as an example of performing a live MySQL database migration.
Shell
1
star
41

proxytester

A set of python scripts and libs for testing a flat file list of anonymous proxies for use in a web browser.
Python
1
star
42

consul-kapacitor

A Kapacitor backend for Chronograf using consul service discovery.
1
star
43

docker-compose-emby

Run the Emby Media Server as a containerized service.
Shell
1
star
44

globd

Python
1
star
45

libgimp.js

Goals: write plugins in JavaScript for GIMP.
Groff
1
star
46

jenkins-bootstrap-github-oauth

A bootstrapped Jenkins instance for testing github-oauth plugin pull requests
Shell
1
star
47

QuaernanHardpointsCarries

Endless Sky game plugin
Shell
1
star
48

docker-jekyll

A development environment for Jekyll which relies on Docker to contain dependencies.
Makefile
1
star
49

docker-distroless

My own flavor of distroless distributions.
C
1
star
50

babytime-reporter

Turn a BabyTime app data export into JSON time series data for rich dashboards in Grafana.
Python
1
star
51

jenkins-bootstrap-ghprb

An immutable Jenkins instance which helps maintainers easily test the GHPRB plugin.
Shell
1
star
52

encfs4win

A read only git mirror of https://gitorious.org/encfs4win
C++
1
star
53

monitoring-scripts

A repository for housing scripts I use for monitoring.
Shell
1
star
54

docker-wireguard

A kernel space VPN operating over UDP from Docker.
Shell
1
star