Giter Club home page Giter Club logo

stateless-jenkins's Introduction

stateless-jenkins

Making use for Jenkinsfile we can ignore jenkins state and spin new instance when required

We can either use stock jenkins/jenkins:lts required plugins will be installed on compose up

docker-compose up

If we use Dockerfile we'd be installing (extra + required) plugins on build stage

env vars

We have all default jenkins/jenkins env vars

AND

PROJECT_GIT specify a project git repo which would be added to jenkins automatically from init.d/job.groovy (optional)

PROJECT_NAME project name (optional) default=Project Name if PROJECT_GIT specified

PROJECT_BUILD if true jenkins will load project branches and build automatically

PROJECT_PLUGINS any extra plugins to be installed on jenkins init

example

      - "PROJECT_GIT=https://github.com/hasnat/stateless-jenkins.git"
      - "PROJECT_NAME=Stateless Jenkins"
      - "PROJECT_BUILD=true"
      - "PROJECT_PLUGINS="

why

So we're not depending on one jenkins, jenkins home don't matter, no back ups needed for jenkins, testing jobs...

linting

We're using https://github.com/miyajan/jflint

for this repo we can use

jflint --csrf-disabled ./Jenkinsfile

run examples

Use following to listen changes on playground and run build in local jenkins

cd projects/playground
git init
git add .
git commit -m "one-commit"
npm install -g watch
watch "clear && git add . && git commit --amend <<< :wq && jflint --csrf-disabled ./Jenkinsfile" . -d

add your project

in docker-compose file mount your project directory to show up as project, add it to master and slave if working with slave making changes to this would force docker-compose to recreate jenkins containers

volumes:
  - "/path/to/your/project/on/host/some-project-name:/usr/local/jenkins-projects/some-project-name"

References:

https://github.com/jenkinsci/pipeline-model-definition-plugin/wiki/getting-started

https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md

https://jenkins.io

stateless-jenkins's People

Contributors

hasnat avatar

Stargazers

Andrew Vaughan avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.