Git Product home page Git Product logo

puppet-jenkins's Introduction

puppet-jenkins

This is a Puppet module which automates the installation and configuration of jenkins, including jobs and slaves.

Example

node "jenkins-master" {
  class { jenkins:
    url => "http://ci.example.com",
    email_address => "[email protected]",
    slaves => ["jenkins-slave01", "jenkins-slave02"],
    views => [
      ["All", ".*"],
      ["Master", ".*master.*"],
      ["Release", ".*release.*"],
    ]
  }

  jenkins::plugin { "port-allocator": version => "1.5" }

  jenkins::job { "app1_master":
    git_repo => "https://github.com/user/app1",
    git_branch => "master",
    command => "./ci.sh",
    triggers => ["app1_master_integration"]
  }

  jenkins::job { "app1_master_integration":
    git_repo => "https://github.com/user/app1",
    git_branch => "master",
    command => "./ci.sh integration",
    poll => false,
    build_schedule => "H H * * *"
  }
}

Features

  • This module recursively manages jenkins directories, so if you remove a job configuration, it will remove the job in jenkins (no orphaned jobs)
  • Jenkins is restarted on changes, so the running jenkins always reflects the files on disk
  • Jobs are very customizable. Take a look at job.pp

Installation

One way to include this module in your puppet repository is to add it as a submodule:

git submodule add https://github.com/pgr0ss/puppet-jenkins.git modules/jenkins
git submodule update --init

License

puppet-jenkins is released under the MIT license.

puppet-jenkins's People

Contributors

pgr0ss avatar unclespeedo avatar

Stargazers

Viraj G. Kulkarni (विराज गु. कुलकर्णी) avatar Pmoranga avatar Valentino Rizzo avatar compwron avatar Azul avatar Peter Dyson avatar Brian Cosgrove avatar

Watchers

 avatar Brian Cosgrove avatar James Cloos avatar  avatar

puppet-jenkins's Issues

`apt-key list` is not qualified

While applying the node with jenkins I got the following error:

Error: Parameter unless failed on Exec[add_jenkins_apt_key]: 'apt-key list | grep 10AF40FE' is not qualified and no path was specified. Please qualify the command or specify a path. at /tmp/vagrant-puppet-1/modules-0/jenkins/manifests/package.pp:10
Wrapped exception:
'apt-key list | grep 10AF40FE' is not qualified and no path was specified. Please qualify the command or specify a path.

Why exec? Why not use puppetlabs/apt?

provision fails if jenkins package is not pre-installed

(puppet provision debug output at end of email)

Just thought I'd mention that I was testing your module on a vanilla install of Ubuntu Precise. FWIW, I'm deploying with vagrant in a vmware fusion VM.

The errors go away if I manually install the jenkins package, it appears that files.pp is loading first but should depend on the jenkins package being installed.

I have not gotten very deep in my troubleshooting, hopefully I haven't overlooked anything obvious.

Cheers,
Ryan

[default] Running provisioner: puppet...
Running Puppet with default.pp...
stdin: is not a tty
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/jenkins/lib/facter/jenkins_version.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/stdlib/lib/facter/facter_dot_d.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/stdlib/lib/facter/pe_version.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/stdlib/lib/facter/puppet_vardir.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/stdlib/lib/facter/root_home.rb
Debug: importing '/tmp/vagrant-puppet-1/modules-0/jenkins/manifests/init.pp' in environment production
Debug: Automatically imported jenkins from jenkins into production
Debug: importing '/tmp/vagrant-puppet-1/modules-0/jenkins/manifests/files.pp' in environment production
Debug: Automatically imported jenkins::files from jenkins/files into production
Debug: Scope(Class[Jenkins::Files]): Retrieving template jenkins/config.xml.erb
Debug: template[/tmp/vagrant-puppet-1/modules-0/jenkins/templates/config.xml.erb]: Bound template variables for /tmp/vagrant-puppet-1/modules-0/jenkins/templates/config.xml.erb in 0.00 seconds
Error: Failed to parse template jenkins/config.xml.erb:
Filepath: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.0.2/lib/puppet/parser/templatewrapper.rb
Line: 70
Detail: Could not find value for 'jenkins_version' at /tmp/vagrant-puppet-1/modules-0/jenkins/templates/config.xml.erb:4
at /tmp/vagrant-puppet-1/modules-0/jenkins/manifests/files.pp:12 on node liquify-build.localdomain
Error: Failed to parse template jenkins/config.xml.erb:
Filepath: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.0.2/lib/puppet/parser/templatewrapper.rb
Line: 70
Detail: Could not find value for 'jenkins_version' at /tmp/vagrant-puppet-1/modules-0/jenkins/templates/config.xml.erb:4
at /tmp/vagrant-puppet-1/modules-0/jenkins/manifests/files.pp:12 on node liquify-build.localdomain
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

puppet apply --verbose --debug --modulepath '/etc/puppet/modules:/tmp/vagrant-puppet-1/modules-0' --manifestdir /tmp/vagrant-puppet-1/manifests --detailed-exitcodes /tmp/vagrant-puppet-1/manifests/default.pp || [ $? -eq 2 ]

Stdout from the command:

Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/jenkins/lib/facter/jenkins_version.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/stdlib/lib/facter/facter_dot_d.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/stdlib/lib/facter/pe_version.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/stdlib/lib/facter/puppet_vardir.rb
Info: Loading facts in /tmp/vagrant-puppet-1/modules-0/stdlib/lib/facter/root_home.rb
Debug: importing '/tmp/vagrant-puppet-1/modules-0/jenkins/manifests/init.pp' in environment production
Debug: Automatically imported jenkins from jenkins into production
Debug: importing '/tmp/vagrant-puppet-1/modules-0/jenkins/manifests/files.pp' in environment production
Debug: Automatically imported jenkins::files from jenkins/files into production
Debug: Scope(Class[Jenkins::Files]): Retrieving template jenkins/config.xml.erb
Debug: template[/tmp/vagrant-puppet-1/modules-0/jenkins/templates/config.xml.erb]: Bound template variables for /tmp/vagrant-puppet-1/modules-0/jenkins/templates/config.xml.erb in 0.00 seconds

Stderr from the command:

stdin: is not a tty
Error: Failed to parse template jenkins/config.xml.erb:
Filepath: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.0.2/lib/puppet/parser/templatewrapper.rb
Line: 70
Detail: Could not find value for 'jenkins_version' at /tmp/vagrant-puppet-1/modules-0/jenkins/templates/config.xml.erb:4
at /tmp/vagrant-puppet-1/modules-0/jenkins/manifests/files.pp:12 on node liquify-build.localdomain
Error: Failed to parse template jenkins/config.xml.erb:
Filepath: /opt/ruby/lib/ruby/gems/1.9.1/gems/puppet-3.0.2/lib/puppet/parser/templatewrapper.rb
Line: 70
Detail: Could not find value for 'jenkins_version' at /tmp/vagrant-puppet-1/modules-0/jenkins/templates/config.xml.erb:4
at /tmp/vagrant-puppet-1/modules-0/jenkins/manifests/files.pp:12 on node liquify-build.localdomain

Error passing

node "jenkins-master" { class { jenkins: url => "http://ci.example.com", email_address => "[email protected]", slaves => ["jenkins-slave01", "jenkins-slave02"], views => [ ["All", ".*"], ["Master", ".*master.*"], ["Release", ".*release.*"], ] }

when i add this to my nodes.pp file it tells me i need to still pass url, etc to jenkins class. i could be using it wrong i am new to puppet

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.