Jenkins main control repo for R10k
Go to file
R. Tyler Croy 2bc2e32777
Change to a new host and username for rating app
2016-04-17 18:18:09 -07:00
ci Perform lint first to speed up the check 2016-04-16 21:57:55 -07:00
dist Need to whitelist puppet 2016-04-17 17:47:01 -07:00
hieradata Change to a new host and username for rating app 2016-04-17 18:18:09 -07:00
manifests moving off l10n service from okra into new host 2016-04-17 08:40:21 -07:00
scripts tab messup 2016-04-15 19:51:14 -07:00
spec [INFRA-636] manage rating app 2016-04-16 17:43:08 -07:00
.fixtures.yml Merge profile::openldap work into profile::ldap 2016-04-16 10:57:44 -07:00
.gitignore Ignore all kinds of vim related mess 2014-09-13 16:08:46 -07:00
.rspec Add a .rspec to hold some RSpec preferences for all invocations 2014-05-10 14:14:48 -07:00
Gemfile Upgrade our internal testing version of Puppet to 4 to match production 2016-04-12 15:00:26 -07:00
Gemfile.lock Upgrade our internal testing version of Puppet to 4 to match production 2016-04-12 15:00:26 -07:00
Jenkinsfile Introduce more gizmos with parallel() to break the work across nodes 2016-01-20 11:51:57 -08:00
Puppetfile Merge profile::openldap work into profile::ldap 2016-04-16 10:57:44 -07:00
README.md Added a command that runs tests locally more quickly 2016-04-17 08:47:09 -07:00
Rakefile Ensure the `validate` Rake task uses the future parser for Puppet4 compat 2016-04-06 09:06:22 -07:00
Vagrantfile Update the vagrant bootstrapping to pull a more recent puppet from apt.puppetlabs.com 2016-04-16 15:02:42 -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 We're in the future now, no need to be explicit about this! 2016-04-07 18:34:22 -07:00
vagrant-bootstrap Add a simple vagrant/puppet-apply based environment on top of AWS 2014-05-02 12:06:40 -07:00

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