Giter Club home page Giter Club logo

puppet-jenkins's Introduction

puppet-jenkins

This is intended to be a re-usable Puppet module that you can include in your own tree.

In order to add this module, run the following commands in your own, presumably Git, puppet tree:

% git submodule add git://github.com/rtyler/puppet-jenkins.git modules/jenkins
% git submodule update --init

Dependencies

The dependencies for this module currently are:

Depending on Jenkins

If you have any resource in Puppet that depends on Jenkins being present, add the following require statement:

exec {
    "some-exec" :
        require => Class["jenkins::package"],
        # ... etc
}

Installing Jenkins plugins

The Jenkins puppet module defines the install-jenkins-plugin resource which will download and install the plugin "by hand"

The names of the plugins can be found on the update site

Latest

By default, the resource will install the latest plugin, i.e.:

jenkins::plugin {
  "git" : ;
}

By version

If you need to peg a specific version, simply specify that as a string, i.e.:

jenkins::plugin {
  "git" :
    version => "1.1.11";
}

Puppet Module Tool

This module is compatible with the puppet module tool. To build a package file of this module, please use the rake build task. The resulting package file may be uploaded to the Puppet Forge.

Quick Start

To quickly try this module with the puppet module tool:

% rake build
% cd /etc/puppet/modules
% sudo puppet-module install /tmp/rtyler-jenkins-0.0.1.tar.gz
Installed "rtyler-jenkins-0.0.1" into directory: jenkins
% sudo puppet apply -v -e 'include jenkins'
info: Loading facts in facter_dot_d
info: Loading facts in facter_dot_d
info: Applying configuration version '1323459431'
notice: /Stage[main]/Jenkins::Repo::El/Yumrepo[jenkins]/descr: descr changed '' to 'Jenkins'
notice: /Stage[main]/Jenkins::Repo::El/Yumrepo[jenkins]/baseurl: baseurl changed '' to 'http://pkg.jenkins-ci.org/redhat/'
notice: /Stage[main]/Jenkins::Repo::El/Yumrepo[jenkins]/gpgcheck: gpgcheck changed '' to '1'
notice: /Stage[main]/Jenkins::Repo::El/File[/etc/yum/jenkins-ci.org.key]/ensure: defined content as '{md5}9fa06089848262c5a6383ec27fdd2575'
notice: /Stage[main]/Jenkins::Repo::El/Exec[rpm --import /etc/yum/jenkins-ci.org.key]/returns: executed successfully
notice: /Stage[main]/Jenkins::Package/Package[jenkins]/ensure: created
notice: /Stage[main]/Jenkins::Service/Service[jenkins]/ensure: ensure changed 'stopped' to 'running'
notice: Finished catalog run in 27.46 seconds

Then the service should be running at http://my.host.name:8080/.

Slaves

An example:

node /jenkins-slave.*/ {
  class { 'jenkins::slave':
    ensure => 'enabled',
    masterurl => 'http://jenkins-master1.domain.com:8080',
    ui_user => 'adminuser',
    ui_pass => 'adminpass',
  }
}

node /jenkins-master.*/ {
    include jenkins
    jenkins::plugin {'swarm':}
    
}

RSpec Testing

This module has behavior tests written using RSpec 2. The goal of these tests are to validate the expected behavior of the module. As more features and platform support are added to this module the tests provide an automated way to validate the expectations previous contributors have specified.

In order to validate the behavior, please run the rake spec task.

% rake spec
(in /Users/jeff/vms/puppet/modules/jenkins)
.
Finished in 0.31279 seconds
1 example, 0 failures

RSpec Testing Requirements

The spec tests require the rspec-puppet gem to be installed. These tests have initially be tested with the following integration of components in addition to this module. Modules such as stdlib may be checked out into the same parent directory as this module. The spec tests will automatically add this parent directory to the Puppet module search path.

  • rspec 2.6
  • rspec-puppet 0.1.0
  • puppet 2.7.6
  • facter 1.6.3
  • stdlib 2.2.0

Installing RSpec Testing Requirements

To install the testing requirements:

% gem install rspec-puppet --no-ri --no-rdoc
Successfully installed rspec-core-2.7.1
Successfully installed diff-lcs-1.1.3
Successfully installed rspec-expectations-2.7.0
Successfully installed rspec-mocks-2.7.0
Successfully installed rspec-2.7.0
Successfully installed rspec-puppet-0.1.0
6 gems installed

Adding Tests

Please see the rspec-puppet project for information on writing tests. A basic test that validates the class is declared in the catalog is provided in the file spec/classes/jenkins_spec.rb. rspec-puppet automatically uses the top level description as the name of a module to include in the catalog. Resources may be validated in the catalog using:

  • contain_class('myclass')
  • contain_service('sshd')
  • contain_file('/etc/puppet')
  • contain_package('puppet')
  • And so forth for other Puppet resources.

puppet-jenkins's People

Contributors

justinellison avatar reidmv avatar shottrue avatar blkperl avatar errorific avatar ekohl avatar jfroche avatar knuton avatar larsfronius avatar haus avatar matthewbarr avatar tbroyer avatar xavier-calland 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.