• Stars
    star
    142
  • Rank 250,344 (Top 6 %)
  • Language
    Groovy
  • License
    BSD 3-Clause "New...
  • Created over 8 years ago
  • Updated over 5 years ago

Reviews

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

Repository Details

This repository is intended for the reference Jenkins configuration as code as well as JobDSL library

Build Status

maintainer: ewelinawilkosz

Jenkins as Code template

Description

The intention of this project is to create the easily configurable template, summarize the current best thinking and create unification for the stateless Jenkins deployments.

Getting started

Recommended setup

  • Linux host that supports Docker
  • Docker 17.05.0-ce (minimal tested version is 1.11.0)
  • Docker Compose 1.13.0 (minimal tested version is 1.7.0)
  • Make sure that you are using umask 022 or similar since during the build process configuration files will be copied to the Jenkins container as a root user but Jenkins runs by another user, so we need to make sure that those files are readable for group and others.

Preparations

  • Clone this repository
git clone https://github.com/Praqma/JenkinsAsCodeReference.git
  • Set proxy variables. If you are still using docker-compose 1.7.0 then you have to do it even if you are not using a proxy because there is a bug in docker-compose which makes args return None instead of empty string. Because of that, if you don't use proxy, you have to define empty environment variables http_proxy, https_proxy, no_proxy. Otherwise you would have those variables set to point out your proxy settings
export http_proxy=<empty or proxy address>
export https_proxy=<empty or proxy address>
export no_proxy=<empty or proxy address>
export JAVA_PROXY=<empty or -Dhttps.proxyHost=<proxy address> -Dhttps.proxyPort=<proxy port> -Dhttp.nonProxyHosts=\"localhost,127.0.0.1|*.whatever.com\" -Dhttp.proxyHost=<proxy address> -Dhttp.proxyPort=<proxy port>

or

cat > ~/.bashrc <<- EOM
export http_proxy=<empty or proxy address>
export https_proxy=<empty or proxy address>
export no_proxy=<empty or proxy address>
export JAVA_PROXY=<empty or -Dhttps.proxyHost=<proxy address> -Dhttps.proxyPort=<proxy port> -Dhttp.nonProxyHosts=\"localhost,127.0.0.1|*.whatever.com\" -Dhttp.proxyHost=<proxy address> -Dhttp.proxyPort=<proxy port>
EOM
source ~/.bashrc

Important! We are using Alpine Linux and apk (package manager) requires proxy address to include schema, i.e. http_proxy=http://my.proxy.com not just http_proxy=my.proxy.com. This only affects http_proxy, https_proxy variables. More details here

  • Create backup directories - they will be used to store build history, user content, Gradle cache and Docker images from the local registry. Also we will use jenkins-backup/workspace directory for mapping to /root/workspace inside slave docker container - it needs to be done for working docker pipeline plugin properly. See JENKINS-35217 for details. You can find the list of all volumes used by this setup inside dockerizeit/docker-compose.yml
mkdir -p $HOME/jenkins-backup/jobs
mkdir -p $HOME/jenkins-backup/userContent
mkdir -p $HOME/jenkins-backup/slave/gradle
mkdir -p $HOME/jenkins-backup/registry
mkdir -p $HOME/jenkins-backup/workspace
# We are running Jenkins as user id 1000 so let him own backup directory to avoid conflicts
chown -R 1000:1000 $HOME/jenkins-backup
  • Make sure that you have $HOME/.ssh directory with the ssh keys for the user that can access GitHub or your own Git hosting. Docker compose will mount $HOME/.ssh to the Jenkins master container so it can create default credentials from it. If you don't want that to happen then remove credentials closures that takes info from /var/jenkins_home/.ssh from jenkins.properties file.

First start

Step into the dockerizeit directory and run docker compose. Important! If you run docker compose from the different directory then make sure to use -p dockerizeit option for the docker compose. There are scripts that rely on services to be called dockerizeit_jmaster_1 and etc.

cd dockerizeit
docker-compose up -d --build

Restart/Start

Download docker-compose.yml attached to the latest deployment pipeline execution and run it using docker-compose

wget <docker compose file url>
docker-compose -p dockerizeit up -d

or pick it from the backup directory

docker-compose -f $HOME/jenkins-backup/jobs/jenkins_as_a_code-pipeline/builds/lastSuccessfulBuild/archive/docker-compose.yml \
-p dockerizeit \
up -d

Configuration

Find detailed description of configuration scripts and configuration file here

Roadmap and contributions

Workflow

Issues labeling follows Pragmatic workflow described here Describe your idea as ticket, make sure to put Action - needs grooming label and let's discuss it together

Contributions verification

We do have Travis CI job running for all branches so make sure it goes green for all your contributions. You can also use review job created on the startup. This job relies on principals described in this article

Project progress

You can see project status on its Waffle board. At some point of time, we will kick off maintainers meetings. Stay tuned

More Repositories

1

helmsman

Helm Charts as Code
Go
1,343
star
2

LearnKubernetes

Notes and resources collected together to help learn Kubernetes. This will eventually become a tutorial and later a blog post for praqma website (hopefully!)
Shell
510
star
3

Network-MultiTool

Multi-arch multitool for container network troubleshooting.
Dockerfile
270
star
4

git-metrics

Util script(s) to scrape data from git repositories to help teams improve.
Python
100
star
5

git-merge-driver

Example of how to configure a custom git merge driver
Shell
96
star
6

learn-traefik

This repository contains examples on using traefik reverse proxy.
85
star
7

praqma-jenkins-casc

Repository for our casc demo setup
Dockerfile
70
star
8

kubernetes-ebook

Kubernetes ebook by Kamran Azeem from Praqma
39
star
9

jira

Atlassian Software in Kubernetes (ASK) - Jira. This repository is no longer being maintained. Please see main README file.
Dockerfile
38
star
10

alpine-sshd

No frills, simple alpine based SSHD server
Dockerfile
29
star
11

AndroidAospInDocker

This is repository with a setup helps to build custom Android aosp images inside docker containers.
Shell
28
star
12

gradle-plugin-bootstrap

All you need to create a custom Gradle plugin
Groovy
26
star
13

smallstep-ca-demo

Demo showing how to provide a behind the firewall Certificate Authority for development environments.
Shell
25
star
14

windows-jenkins-slaves-with-packer

Provision and start Windows Jenkins build slaves using Packer and Terraform.
HCL
23
star
15

git-hooks

Ruby
21
star
16

confluence

Atlassian Software in Kubernetes (ASK) - Confluence. This repository is no longer being maintained. Please see main README file.
Dockerfile
20
star
17

Praqmatic-Automated-Changelog

A repository for PAC (Praqmatic Automated Changelog)
Ruby
20
star
18

DAME

DAME is the Dockerized Arcade Machine Emulator, allowing you to play old games on your laptop!
Shell
17
star
19

2git

A Groovy DSL to migrate from ClearCase to Git
Groovy
16
star
20

code-utils

Continuous Delivery utilities - small scripts and concepts used by in continuous delivery setups.
Groovy
14
star
21

bitbucket

Atlassian Software in Kubernetes (ASK) - Bitbucket. This repository is no longer being maintained. Please see main README file.
Dockerfile
14
star
22

memory-map-plugin

A repository for the memory-map-plugin
Java
13
star
23

staci

Containerizing the Atlassian tools stack. Jira, Confluence, Bamboo and a MySQL database.
Shell
12
star
24

ask

Helm and Helmsman charts for ASK. This repository is no longer being maintained. Please see main README file.
Shell
11
star
25

job-dsl-collection

Job DSL collection library
Groovy
9
star
26

pretested-integration-plugin

A generic pretest commit plugin for Jenkins CI
Java
7
star
27

artifactory-retention

Clone & Own solution for Artifactory Retention Policies
Groovy
7
star
28

atlassian-metrics

Groovy
6
star
29

traefik-bitbucker-docker-demo

A demo of a dockerized Bitbucket instance proxied with Traefik and automated SSL cert management.
Shell
6
star
30

deploy2docker

A tool-set to deploy docker-compose apps to a plain docker-compose server
Shell
6
star
31

questionnaire-engine

Containerized web application to create and analyze surveys
JavaScript
6
star
32

reveals

HTML
5
star
33

jobdsl-helpers

Collection of classes to simplify JobDSL snippets
Groovy
4
star
34

GodotDevOps

A summer project exploring contemporary software development and DevOps in a game dev setting
GDScript
4
star
35

jcasc-core

docker images to be used for jcasc powered jenkins
Dockerfile
4
star
36

praqmajutils

Praqma Java Utils
Java
4
star
37

native

Examples of Native Builds
4
star
38

rook-ask-demo

A demo for Code-Conf 2019 showing Rook and ASK
Shell
4
star
39

k8s-cloud-loadbalancer

The Load Balancer is now a separate repository instead of being a sub directory inside praqma/LearnKubernetes
Shell
4
star
40

jcasc-conf

Example wrapper for running Jenkins with prebuilt docker images with JCasC
Shell
3
star
41

sdelements-plugin

Jenkins plugin for SD Elements risk assessment tool by Security Compass
Java
3
star
42

VersionedBinaryArtifacts

A gradle plugin to allow a build be defined in a properties file
Groovy
3
star
43

tracey

Initial repo for the Tracey implementation
Groovy
3
star
44

git-artifact

Shell
3
star
45

vaultReference

This is a reference project on how to easily and fast get Vault up and run in a production ready setup.
Shell
3
star
46

gradle-docker-plugin

Groovy
3
star
47

jenkins4casc

Dockerfile repository for a Jenkins preconfigured with Jenkins Configuration as Code plugin
Dockerfile
3
star
48

AWSProvisionWithAnsible

Configure Docker devicemapper storage for AWS RHEL 7 instance using Ansible
Python
3
star
49

shared-pipeline

Repository with shared global pipeline libs. Usable within sandboxed objects
Groovy
2
star
50

drmemory-plugin

Java
2
star
51

logging-plugin

Java
2
star
52

PrometheusGrafana

This is a repository for the demo at the christmas workshop. People have asked for it as a repository. :)
Shell
2
star
53

packer-made-win-slave

Templates and tools to build Windows-based using packer
PowerShell
2
star
54

CodeCamp

Java
2
star
55

helmsman-demo

2
star
56

ngingo

A tiny web server that makes a point
Go
2
star
57

onboarding-as-code

Automating the onboarding process
Python
2
star
58

commit-message-parser

Collection of parsers to extract issues from commit messages
Java
2
star
59

AbstractVcsApi

Java
2
star
60

OctoCopDD

OctoCop (Traffic) Director for Docker
Shell
2
star
61

native-example-scons

C++
2
star
62

concourse-git-phlow

concourse wrapper for git-phlow
Go
2
star
63

metricviz

Code metrics visualization POC
Java
2
star
64

toggleR

A simple R package to read data from toggl
R
2
star
65

dcn-2018-introduction-to-k8s

Kamran's presentation / workshop on Day Of CloudNative 2018.
Shell
2
star
66

k8s-probes-demo

A small Docker image, and related files to demonstrate how kubernetes probes work
Shell
1
star
67

memory-map-examples

Repository to hold example projects for our memory map plugin
1
star
68

ansible4win-poc

Showcase for Ansible configuration and management of Windows nodes as build and test agents
Ruby
1
star
69

CI-with-HAProxy

Shell
1
star
70

MonKit-Plugin

Java
1
star
71

terraform-google-gke

Terraform modules for creating kubernetes clusters in Google cloud (GKE)
HCL
1
star
72

helm-echoserver

A simple Go echoserver built with Echo framework.
Go
1
star
73

drmemory-api

Java
1
star
74

simple-website

A very simple HTML website which is often needed during git/docker/kubernetes labs/demos
HTML
1
star
75

topdesk-linker

Java
1
star
76

native-example-bazel

C++
1
star
77

makeable-deployment-poc

POC for makeable
Shell
1
star
78

toggl-metric

R library to fetch toggl data and generic methods to handle it.
R
1
star
79

selenoid

This is a simple Selenoid example. Selenoid is basically selenium grid as containers. See https://aerokube.com/selenoid/.
Shell
1
star
80

jekyll

Docker built Jekyll image for building Praqma's website.
Shell
1
star
81

Matrix-Reloaded-Plugin

A Jenkins plugin to rebuild matrix builds
Java
1
star
82

First

Java
1
star
83

luci-gradle

Gradle plugin for Luci
Groovy
1
star
84

docker-gh-pages

Dockerfile for creating a docker container for building jekyll enabled Github pages.
Ruby
1
star
85

rqm-plugin

Java
1
star
86

tracey-rabbitmq-neo4j-bridge

Java
1
star
87

Docker-Birthday-3-Oslo

Repo to contain some helpful stuff related to Docker Birthday event - 2016
HTML
1
star
88

vcs-bridge-plugin

Java
1
star
89

dgoss-docker-image

Shell
1
star
90

MonKit

Java
1
star
91

ccanalyzer

Java
1
star
92

docker-linkchecker

Shell
1
star
93

praqma.github.io

The home of http://code.praqma.com. It's repo that will host documentation for all our development
CSS
1
star
94

file-pattern-scanner

Simple script that scans flat/plain text files for patterns predefined in rules
Groovy
1
star
95

yocto-build-container

Ubuntu-based Docker base image for building Yocto images
Dockerfile
1
star
96

makeable-deployment-poc-code

PHP code for makable repository
PHP
1
star
97

terraform-jenkins-artifactory

A terraform/packer setup to create a simple CI system
HCL
1
star
98

PlusBump

This project was previously known as by its temp name "Wincrementor". Content will be updated soon to match the new name.
Ruby
1
star
99

tracey-protocol-eiffel

Ericsson Eiffel protocol implementation for the Tracey framework
Java
1
star