-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf42f96
commit 767bdd9
Showing
133 changed files
with
7,091 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
default: --publish-quiet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule puppet_controlrepo
deleted from
4ad5d0
9 changes: 9 additions & 0 deletions
9
spec/fixtures/controlrepos/puppet_controlrepo/.atom-build.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"cmd": "bundle exec onceover run spec", | ||
"name": "onceover spec", | ||
"cwd": "{PROJECT_PATH}", | ||
"errorMatch": [ | ||
"compilation:\\s.*production\\/(?<file>[\\w\\/]*.pp):(?<line>\\d*):(?<col>\\d*)" | ||
], | ||
"atomCommandName": "onceover:spec" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.onceover | ||
.DS_Store | ||
.bundle | ||
Gemfile.lock | ||
vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.2.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
language: ruby | ||
|
||
cache: | ||
bundler: true | ||
directories: | ||
- .onceover | ||
|
||
script: bundle exec onceover run spec --force | ||
bundler_args: --without development --path vendor/bundle | ||
|
||
rvm: | ||
- 2.3.0 | ||
- 2.3.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
source 'https://rubygems.org' | ||
|
||
group :development do | ||
gem 'pry' | ||
gem 'pry-byebug' | ||
gem 'rb-readline' | ||
gem 'puppet-debugger' | ||
end | ||
|
||
if ENV['ONCEOVER_gem'] == 'local' | ||
gem 'onceover', :path => '/Users/dylan/git/onceover' | ||
# gem 'onceover-octocatalog-diff', :path => '/Users/dylan/git/onceover-octocatalog-diff' | ||
else | ||
gem 'onceover', :git => 'https://github.com/dylanratcliffe/onceover.git'#, :branch => 'issue-51' | ||
# gem 'onceover-octocatalog-diff', :git => 'https://github.com/dylanratcliffe/onceover-octocatalog-diff.git' | ||
end | ||
|
||
gem 'hiera-eyaml' | ||
gem 'puppet', ENV['PUPPET_version'] || '~> 8' | ||
|
||
# Require by telegraf module | ||
gem 'toml-rb' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
node { | ||
puppet.credentials 'PE-Deploy-Token' | ||
stage('Git Checkout') { // for display purposes | ||
// Get some code from a GitHub repository | ||
checkout([ | ||
$class: 'GitSCM', | ||
branches: [[name: env.BRANCH_NAME]], | ||
doGenerateSubmoduleConfigurations: false, | ||
userRemoteConfigs: [[url: 'https://github.com/dylanratcliffe/puppet_controlrepo.git']]]) | ||
} | ||
stage('Install Gems') { | ||
// Run the onceover tests | ||
sh '''source /usr/local/rvm/scripts/rvm && bundle install --path=.gems --binstubs''' | ||
} | ||
stage('Run Onceover Tests') { | ||
// Run the onceover tests | ||
try { | ||
sh '''source /usr/local/rvm/scripts/rvm && ./bin/onceover run spec''' | ||
} catch (error) { | ||
junit '.onceover/spec.xml' | ||
throw error | ||
} | ||
} | ||
stage('Deploy Code') { | ||
echo env.BRANCH_NAME | ||
puppet.codeDeploy env.BRANCH_NAME | ||
} | ||
stage('Run Puppet') { | ||
// Get all of the classes that have changed | ||
changedClasses = sh(returnStdout: true, script: './scripts/get_changed_classes.rb').trim().split('\n') | ||
// Get the number of classes that have changed | ||
numChangedClasses = sh(returnStdout: true, script: './scripts/count_changed_classes.rb').trim().toInteger() | ||
// Generate a query that we will use | ||
nodeQuery = ('nodes { resources { type = "Class" and title in ' + ("[\"" + changedClasses.join("\",\"") + "\"]") + ' } and catalog_environment = "' + env.BRANCH_NAME +'" }').toString() | ||
// If things have changed then execute the query | ||
if (numChangedClasses > 0) { | ||
echo nodeQuery | ||
affectedNodes = puppet.query nodeQuery | ||
// If nothing has been affected by the change we don't need to try to | ||
// initiate the run | ||
if (affectedNodes.size() > 0) { | ||
puppet.job env.BRANCH_NAME, query: nodeQuery | ||
} else { | ||
echo "Classes: " + changedClasses.join(",") + " changed. But no nodes were affected, skipping run." | ||
} | ||
} else { | ||
echo "No classes changed, skipping this step." | ||
} | ||
} | ||
} |
Oops, something went wrong.