Jenkins main control repo for R10k
Go to file
R. Tyler Croy cde1b0c033
WIP, working on getting modules to the PE host
2016-06-27 12:07:46 -07:00
beaker Add work-in-progress configuration to run Beaker on Docker 2016-06-27 12:07:46 -07:00
ci
dist Upgrade the demo instance to 2.10 2016-06-27 11:36:47 -07:00
hieradata I am told that the parallel-test-executor makes things faster 2016-06-16 10:39:55 -07:00
manifests Make kelp a census::agent 2016-06-08 12:57:25 -07:00
scripts script to send password reset email 2016-04-26 10:32:14 -07:00
spec WIP, working on getting modules to the PE host 2016-06-27 12:07:46 -07:00
.fixtures.yml Jump to a later version of the r10k module which supports the github secret param 2016-05-02 17:49:07 -07:00
.gitignore
.rspec
Gemfile Upgrade beaker 2016-06-27 12:07:46 -07:00
Gemfile.lock Upgrade beaker 2016-06-27 12:07:46 -07:00
Jenkinsfile Discard old builds. 2016-05-10 08:08:26 -07:00
Puppetfile Jump to a later version of the r10k module which supports the github secret param 2016-05-02 17:49:07 -07:00
README.md Added a command that runs tests locally more quickly 2016-04-17 08:47:09 -07:00
Rakefile
Vagrantfile Refactored how vagrant specific overrides kick in. 2016-04-29 15:51:36 -07:00
check Adding a note, though fixture setup time is already discussed in README 2016-04-17 09:24:46 -07:00
environment.conf
vagrant-bootstrap

README.md

Jenkins Infra

BuildStatus

This repository is the r10k control repository for the Jenkins project's own infrastructure.

Local development

The amount of testing that can be done locally is as follows:

  • bundle install - To get the necessary gems to run tests locally, if you're unfamiliar with Ruby development you may want to use RVM to create an isolated Ruby environment
  • ./check - Will run the rspec-puppet unit tests and the puppet-lint style validation. If you intend to run the rspec-puppet over and over, use rake spec_standalone to avoid re-initializing the Puppet module fixtures every time.

Vagrant-based testing

Pre-requisites

  • Import your SSH public key into a key pair into the us-west-2 region. We have an AMI in us-west-2 that has Ubuntu 12.04, Puppet and a Docker-capable kernel installed for testing
  • Make sure your default security group allows SSH (port 22) from the outside world.
  • Run the ./vagrant-bootstrap script locally to make sure your local environment is prepared for Vagranting

Running server spec tests

We're using serverspec for on-machine acceptance testing. Combined with Vagrant, this allows us to create an acceptance test per-role which provisions and tests an entire Puppet catalog on a VM.

Pre-requisites
  • Install Vagrant
  • Install Vagrant plugins: vagrant plugin install vagrant-aws vagrant-serverspec

To launch a test instance, vagrant up ROLE where ROLE is one of the defined roles. You can rerun puppet and execute tests with vagrant provision ROLE repeatedly while the VM is up and running. To just rerun serverspect without puppet, vagrant provision --provision-with serverspec ROLE. When it's all done, deprovision the instance via vagrant destroy ROLE.

Updating dependencies

For reasons that Tyler will hopefully clarify at some point, this module maintains the list of Puppet module dependencies in Puppetfile and .fixtures.yml. They need to be kept in sync. When you modify them, you can have the local environment reflect changes by running bundle exec rake resolve.

Branching model

The default branch of this repository is staging which is where pull requests should be applied to by default.


+----------------+
| pull-request-1 |
+-----------x----+
             \
              \ (review and merge, runs acceptance tests)
staging        \
|---------------o--x--x--x---------------->
                          \
                           \ (manual merge, auto-deploys to prod hosts)
production                  \
|----------------------------o------------->

The branching model is a little different than what you might be familiar with. We merge pull requests into a special branch called staging where we can run Puppet acceptance tests from. Once somebody has code reviewed a pull request it can be merged into staging.

When a infra project team member is happy with the code in staging they can create a merge from staging to production. Once something has been merged to production, it will be automatically deployed to production hosts.

Installing agents

For installing agents refer to the installing agents section of the PuppetLabs documentation.

Adding a new branch/environment

"Dynamic environments" are in a bit of flux for the current version (3.7) of Puppet Enterprise that we're using. An unfortunate side-effect of this is that creating a branch in this repository is not sufficient to create a dynamic environment that can be used via the Puppet master.

The enable an environment, add a file on the Puppet master: /etc/puppetlabs/puppet/environments/my-environment-here/environment.conf with the following:

modulepath = ./dist:./modules:/opt/puppet/share/puppet/modules
manifest = ./manifests/site.pp

Contributing