Skip to content

Instantly share code, notes, and snippets.

View jskarpe's full-sized avatar

Jon Skarpeteig jskarpe

  • Signicat AS
  • Norway
View GitHub Profile
pipeline {
agent any
stages {
stage('Prepare') {
steps {
sh 'composer install'
sh 'rm -rf build/api'
sh 'rm -rf build/coverage'
sh 'rm -rf build/logs'
refacter { 'monitoring':
patterns => [
'^apache_',
],
}
Service <| title != 'collectd' |> {
before +> Class['monitoring::metrics::collectd'],
notify +> Refacter['monitoring']
}
stage { 'last': }
Stage['main'] -> Stage['last']
class { 'apache2': }
class { 'monitoring':
stage => last
}
node 'www1.example.com' {
include ::apache
include ::monitoring
}
if ($::apache_statuspage_enabled) {
include ::collectd::plugin::apache
}
node 'www1.example.com' {
include ::apache
sensu::check { 'apache2':
command => 'check-process.rb --pattern apache2 --warn-under 1'
}
}
class apache2 {
package { 'apache2': ensure => present }
service { 'apache2:' ensure => running }
sensu::check { 'apache2':
command => 'check-process.rb --pattern apache2 --warn-under 1'
}
}
@jskarpe
jskarpe / build.xml
Last active June 22, 2016 06:12
Puppet module testing with acceptance tests in parallel using Apache Ant. Simplifies integration with Jenkins
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="build">
<target name="build" depends="clean,bundle-install,syntax,lint">
<antcall target="spec" />
<antcall target="acceptance" />
</target>
<target name="clean">
<delete includeemptydirs="true" removeNotFollowedSymlinks="true" failonerror="false">
#!/bin/bash
# MakeGood for PHP stopped working after Eclipse Indigo (3.8) due to inability to run testrunner.php
# This is a hack PHP binary, to be configured as PHP executable for MakeGood to start working in Juno, Kepler and Luna.
# Remove the -n operator to read all config files
options=`echo $@ | sed 's%-n %%' | sed 's%-c .+? %%'`
# Hardcode path to testrunner.php
options=`echo $options | sed 's@open_tag=on [^ ]*@open_tag=on /opt/testrunner.php
@jskarpe
jskarpe / gist:5716947
Last active December 18, 2015 03:19 — forked from faleev/gist:3435377