From 2fce2245a6bc4d56539ca4e6f69fcae2faedc084 Mon Sep 17 00:00:00 2001 From: Arne Teuke Date: Tue, 7 Sep 2021 15:31:02 +0200 Subject: [PATCH] update repo --- .mdl_style.rb | 4 ++++ .mdlrc | 2 ++ .spelling | 32 ++++++++++++++++++++++++++++++++ Gemfile | 3 ++- Jenkinsfile | 28 +++++++++++++++++++++++++--- 5 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 .mdl_style.rb create mode 100644 .mdlrc create mode 100644 .spelling diff --git a/.mdl_style.rb b/.mdl_style.rb new file mode 100644 index 0000000..267f8d6 --- /dev/null +++ b/.mdl_style.rb @@ -0,0 +1,4 @@ +all +# exlude line lenght +# exclude_rule 'MD013' +rule 'MD013', :line_length => 1000 diff --git a/.mdlrc b/.mdlrc new file mode 100644 index 0000000..e5c563a --- /dev/null +++ b/.mdlrc @@ -0,0 +1,2 @@ +style '.mdl_style.rb' + diff --git a/.spelling b/.spelling new file mode 100644 index 0000000..739ad58 --- /dev/null +++ b/.spelling @@ -0,0 +1,32 @@ +# markdown-spellcheck spelling configuration file +# Format - lines begining # are comments +# global dictionary is at the start, file overrides afterwards +# one word per line, to define a file override use ' - filename' +# where filename is relative to this configuration file +Readme.md +httpd +sudo +selinux +site.pp +nodes.pp +cd_apache +:: +params +Foreman +cd_resources +CentOS +Puppet +ConfDroid +nagios +vHosts +vHost +phpMyAdmin +phpPgAdmin +parameterized +erb +Confdroid.com +UTF_Files +Elasticsearch +cd_firewall +puppetlabs +cd_elasticsearch diff --git a/Gemfile b/Gemfile index e9584ba..49f82d7 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' puppetversion = ENV.key?('PUPPET_VERSION') ? ENV['PUPPET_VERSION'] : ['<= 5.5.6'] gem 'metadata-json-lint', '~> 2.4' gem 'puppet', puppetversion -gem 'puppetlabs_spec_helper', '>= 1.0.0' +gem 'puppetlabs_spec_helper', '~> 3.0' gem 'puppet-lint' gem 'facter' gem 'rspec-puppet' @@ -15,6 +15,7 @@ gem 'rgen' gem 'public_suffix', '<= 2.0.5' gem 'parallel', '<= 1.13.0' gem 'puppet-syntax', '~> 2.6', '>= 2.6.1' +gem 'pathspec', '~> 0.2.1' # rspec must be v2 for ruby 1.8.7 if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' diff --git a/Jenkinsfile b/Jenkinsfile index c57b684..b9e6c5f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -70,13 +70,35 @@ pipeline { } } - stage('update repo structure') { + stage('markdown-lint') { steps { - sh '''rm -Rf REPOSTRUCTURE.md - echo "$(tree --dirsfirst --charset=ascii .)" > REPOSTRUCTURE.md''' + sh ''' + source /opt/rh/rh-ruby27/enable + mdl README.md + ''' } } + stage('spell check') { + steps { + sh ''' + mdspell -r -n -a "**/*.md" + ''' + } + } + + stage('SonarScan') { + steps { + sh ''' + /opt/sonar-scanner/bin/sonar-scanner \ + -Dsonar.projectKey=cd_fail2ban \ + -Dsonar.sources=. \ + -Dsonar.host.url=http://sonarqube.confdroid.com \ + -Dsonar.login=f4d68d1f43370b34439eee7fbf5e2b6182cf449c + ''' + } + } + stage('create Puppet documention') { steps { sh '/opt/puppetlabs/bin/puppet strings'