add jenkinsfile

This commit is contained in:
12WW1160
2020-12-04 16:12:16 +01:00
parent 79ddd8b101
commit d35987d63e
4 changed files with 49 additions and 264 deletions

View File

@@ -1,81 +0,0 @@
<h1> Git Changelog changelog </h1>
<p>
Changelog of Git Changelog.
</p>
<h2> Unreleased </h2>
<h2> No issue </h2>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/199800e57a69be9">199800e57a69be9</a> Jenkins Server <i>2017-08-03 11:35:51</i>
<p>
<h3>recommit for updates in build 7</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/73df1183c06d683">73df1183c06d683</a> Jenkins Server <i>2017-07-20 12:47:36</i>
<p>
<h3>recommit for updates in build 4</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/dfeece2215322e3">dfeece2215322e3</a> Jenkins Server <i>2017-07-20 12:43:32</i>
<p>
<h3>recommit for updates in build 3</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/c7e77e4c88c5b5a">c7e77e4c88c5b5a</a> Jenkins Server <i>2017-07-20 12:08:03</i>
<p>
<h3>recommit for updates in build 2</h3>
</p>
<h2> v0.0.1.0 </h2>
<h2> No issue </h2>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/0bd13076fd01a31">0bd13076fd01a31</a> Arne Teuke <i>2017-08-03 11:36:11</i>
<p>
<h3>updated parameter documentation and README</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/a1177ccacf0d7d5">a1177ccacf0d7d5</a> Arne Teuke <i>2017-08-03 11:24:18</i>
<p>
<h3>added selinux status configuration</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/914509740f787b8">914509740f787b8</a> Arne Teuke <i>2017-08-03 11:19:53</i>
<p>
<h3>added selinux status configuration</h3>
</p>
<h2> v0.0.0.3 </h2>
<h2> No issue </h2>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/8b184516c46ea66">8b184516c46ea66</a> Arne Teuke <i>2017-07-20 12:47:27</i>
<p>
<h3>edited README</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/6e8e556e2e2f7ef">6e8e556e2e2f7ef</a> Arne Teuke <i>2017-07-20 12:46:33</i>
<p>
<h3>changed repo dependency</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/9f8a0aef46d59dd">9f8a0aef46d59dd</a> Arne Teuke <i>2017-07-20 12:43:17</i>
<p>
<h3>added main config file control</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/8b0100d73a0a456">8b0100d73a0a456</a> Arne Teuke <i>2017-07-20 12:07:11</i>
<p>
<h3>added main config file control</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/d6485074480abf9">d6485074480abf9</a> Arne Teuke <i>2017-07-20 11:49:07</i>
<p>
<h3>added main directory control</h3>
</p>

View File

@@ -1,7 +1,7 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
puppetversion = ENV.key?('PUPPET_VERSION') ? ENV['PUPPET_VERSION'] : ['<= 5.5.6']
gem 'metadata-json-lint'
gem 'metadata-json-lint', '~> 2.4'
gem 'puppet', puppetversion
gem 'puppetlabs_spec_helper', '>= 1.0.0'
gem 'puppet-lint'
@@ -9,10 +9,12 @@ gem 'facter'
gem 'rspec-puppet'
gem 'yard'
gem 'puppet-strings', '< 2.0.0'
gem 'rake'
gem 'rake', '~> 12.3', '>= 12.3.3'
gem 'semantic_puppet'
gem 'rgen'
gem 'public_suffix', '<= 2.0.5'
gem 'parallel', '<= 1.13.0'
gem 'puppet-syntax', '~> 2.6', '>= 2.6.1'
# rspec must be v2 for ruby 1.8.7
if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9'

209
Jenkinsfile vendored
View File

@@ -3,9 +3,24 @@ pipeline {
label 'puppet'
}
post {
always {
deleteDir() /* clean up our workspace */
}
success {
updateGitlabCommitStatus state: 'success'
echo 'Pipeline finished successfully!'
}
failure {
updateGitlabCommitStatus state: 'failed'
echo 'I failed :('
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'support@confdroid.com', sendToIndividuals: true])
}
}
stages {
stage('pulling master before adding files') {
stage('pulling master') {
steps {
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
sh '''git config user.name "Jenkins Server"
@@ -16,13 +31,29 @@ pipeline {
}
}
stage('install required gems') {
stage('install gems') {
steps {
sh 'bundle install'
}
}
stage('puppet-lint tests') {
stage('puppet parser') {
steps {
sh '''for file in $(find . -iname \'*.pp\'); do
/opt/puppetlabs/bin/puppet parser validate --color false --render-as s --modulepath=modules $file || exit 1;
done;'''
}
}
stage('check templates') {
steps{
sh '''for file in $(find . -iname \'*.erb\');
do erb -P -x -T "-" $file | ruby -c || exit 1;
done;'''
}
}
stage('puppet-lint') {
steps {
sh '''find . -iname *.pp -exec /var/lib/jenkins/bin/puppet-lint \\
--no-class_inherits_from_params_class-check \\
@@ -31,29 +62,9 @@ pipeline {
--no-arrow_alignment-check \\
--no-autoloader_layout-check \\
--no-140chars-check \\
--log-format "%{path}:%{line}:%{check}:%{KIND}:%{message}" {} \\;'''
}
}
stage('puppet parser test') {
steps {
sh '''for file in $(find . -iname \'*.pp\'); do
/opt/puppetlabs/bin/puppet parser validate --color false --render-as s --modulepath=modules $file || exit 1;
done;'''
}
}
stage('Puppet ERB template test') {
steps{
sh '''for file in $(find . -iname \'*.erb\');
do erb -P -x -T "-" $file | ruby -c || exit 1;
done;'''
}
}
stage('compiler warnings') {
steps {
warnings canComputeNew: false, canResolveRelativePaths: false, consoleParsers: [[parserName: 'Puppet-Lint']], defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', unHealthy: ''
--log-format "%{path}:%{line}:%{check}:%{KIND}:%{message}" {} \\;
'''
recordIssues aggregatingResults: true, tool: puppetLint()
}
}
@@ -70,125 +81,7 @@ pipeline {
}
}
stage('create changelog') {
steps{
step([$class: 'GitChangelogRecorder', config: [configFile: 'git-changelog-settings.json', createFileTemplateContent: '''<h1> Git Changelog changelog </h1>
<p>
Changelog of Git Changelog.
</p>
{{#tags}}
<h2> {{name}} </h2>
{{#issues}}
{{#hasIssue}}
{{#hasLink}}
<h2> {{name}} <a href="{{link}}">{{issue}}</a> {{title}} </h2>
{{/hasLink}}
{{^hasLink}}
<h2> {{name}} {{issue}} {{title}} </h2>
{{/hasLink}}
{{/hasIssue}}
{{^hasIssue}}
<h2> {{name}} </h2>
{{/hasIssue}}
{{#commits}}
<a href="https://gitlab.confdroid.com/12WW1160/git-changelog-lib/commit/{{hash}}">{{hash}}</a> {{authorName}} <i>{{commitTime}}</i>
<p>
<h3>{{{messageTitle}}}</h3>
{{#messageBodyItems}}
<li> {{.}}</li>
{{/messageBodyItems}}
</p>
{{/commits}}
{{/issues}}
{{/tags}}
''', createFileTemplateFile: '', createFileUseTemplateContent: true, createFileUseTemplateFile: false, customIssues: [[link: '', name: '', pattern: '', title: ''], [link: '', name: '', pattern: '', title: '']], dateFormat: 'YYYY-MM-dd HH:mm:ss', file: 'CHANGELOG.md', fromReference: '', fromType: 'firstCommit', gitHubApi: '', gitHubApiTokenCredentialsId: '', gitHubIssuePattern: '#([0-9]+)', gitHubToken: '', gitLabApiTokenCredentialsId: '', gitLabProjectName: '', gitLabServer: '', gitLabToken: '', ignoreCommitsIfMessageMatches: '^\\[maven-release-plugin\\].*|^\\[Gradle Release Plugin\\].*|^Merge.*', ignoreCommitsWithoutIssue: false, ignoreTagsIfNameMatches: '', jiraIssuePattern: '\\b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\\b', jiraPassword: '', jiraServer: '', jiraUsername: '', jiraUsernamePasswordCredentialsId: '', mediaWikiPassword: '', mediaWikiTemplateContent: '''__NOTOC__
= Git Changelog changelog =
Changelog of Git Changelog.
{{#tags}}
== {{name}} ==
{{#issues}}
{{#hasIssue}}
{{#hasLink}}
=== {{name}} [{{link}} {{issue}}] {{title}} ===
{{/hasLink}}
{{^hasLink}}
=== {{name}} {{issue}} {{title}} ===
{{/hasLink}}
{{/hasIssue}}
{{^hasIssue}}
=== {{name}} ===
{{/hasIssue}}
{{#commits}}
[https://gitlab.confdroid.com/12WW1160/git-changelog-lib/commit/{{hash}} {{hash}}] {{authorName}} {{commitTime}}
\'\'\'{{{messageTitle}}}\'\'\'
{{#messageBodyItems}}
* {{.}}
{{/messageBodyItems}}
{{/commits}}
{{/issues}}
{{/tags}}
''', mediaWikiTemplateFile: '', mediaWikiTitle: '', mediaWikiUrl: '', mediaWikiUseTemplateContent: false, mediaWikiUseTemplateFile: false, mediaWikiUsername: '', noIssueName: 'No issue', readableTagName: '/([^/]+?)$', showSummary: false, showSummaryTemplateContent: '''<h1> Git Changelog changelog </h1>
<p>
Changelog of Git Changelog.
</p>
{{#tags}}
<h2> {{name}} </h2>
{{#issues}}
{{#hasIssue}}
{{#hasLink}}
<h2> {{name}} <a href="{{link}}">{{issue}}</a> {{title}} </h2>
{{/hasLink}}
{{^hasLink}}
<h2> {{name}} {{issue}} {{title}} </h2>
{{/hasLink}}
{{/hasIssue}}
{{^hasIssue}}
<h2> {{name}} </h2>
{{/hasIssue}}
{{#commits}}
<a href="https://gitlab.confdroid.com/12WW1160/git-changelog-lib/commit/{{hash}}">{{hash}}</a> {{authorName}} <i>{{commitTime}}</i>
<p>
<h3>{{{messageTitle}}}</h3>
{{#messageBodyItems}}
<li> {{.}}</li>
{{/messageBodyItems}}
</p>
{{/commits}}
{{/issues}}
{{/tags}}
''', showSummaryTemplateFile: '', showSummaryUseTemplateContent: false, showSummaryUseTemplateFile: false, subDirectory: '', timeZone: 'UTC', toReference: '', toType: 'master', untaggedName: 'Unreleased', useConfigFile: false, useFile: true, useGitHub: false, useGitHubApiTokenCredentials: false, useGitLab: false, useGitLabApiTokenCredentials: false, useIgnoreTagsIfNameMatches: false, useJira: false, useJiraUsernamePasswordCredentialsId: false, useMediaWiki: false, useReadableTagName: false, useSubDirectory: false]])
}
}
stage('show diff') {
steps {
sh 'git diff'
}
}
stage('recommit changes to repo') {
stage('update repo') {
steps {
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
sh '''git config user.name "Jenkins Server"
@@ -198,31 +91,5 @@ Changelog of Git Changelog.
}
}
}
stage('update Gitlab') {
steps {
updateGitlabCommitStatus state: 'success'
}
}
}
post {
always {
deleteDir() /* clean up our workspace */
}
success {
echo 'Pipeline finished successfully!'
}
unstable {
echo 'I am unstable :/'
}
failure {
echo 'I failed :('
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'support@confdroid.com', sendToIndividuals: true])
}
changed {
echo 'Things were different before...'
mail bcc: '', body: "Pipeline Job '${JOB_NAME}' has changed, please verify.", cc: '', from: '', replyTo: '', subject: "Pipeline Job '${JOB_NAME}' has changed", to: 'support@confdroid.com'
}
}
}

View File

@@ -1,6 +1,4 @@
|Repo Name| version | Build Status|
|---|---|---|---|
|`cd_selinux`| 0.0.1.1 | [![Build Status](https://pipelines.confdroid.com/buildStatus/icon?job=cd_selinux)](https://pipelines.confdroid.com/job/cd_selinux/)|
[![Build Status](https://pipelines.confdroid.com/buildStatus/icon?job=cd_selinux)](https://pipelines.confdroid.com/job/cd_selinux/)
### Synopsis
[Security-Enhanced Linux (SELinux) is a Linux kernel security module that provides a mechanism for supporting access control security policies.](https://en.wikipedia.org/wiki/Security-Enhanced_Linux)
@@ -12,7 +10,7 @@
### Table of Contents
* [Features](#features)
* [Repo Structure](https://gitlab.confdroid.com/12WW1160/cd_selinux/blob/master/REPOSTRUCTURE.md)
* [Repo Structure](https://sourcecode.confdroid.com/12WW1160/cd_selinux/blob/master/REPOSTRUCTURE.md)
* [Dependencies](#dependencies)
* [Deployment](#deployment)
* [native Puppet deployment](#native-puppet-deployment)
@@ -24,7 +22,6 @@
* [Known Problems](#known-problems)
* [Support](#support)
* [Tests](#tests)
* [Changelog](https://gitlab.confdroid.com/12WW1160/cd_selinux/blob/master/CHANGELOG.md)
* [Contact Us](https://confdroid.com/contact/)
* [Disclaimer](#disclaimer)
@@ -45,7 +42,7 @@ Repostructure has moved to REPOSTRUCTURE.md in repo.
### Dependencies
All dependencies must be included in the catalogue.
* [cd_resources](https://gitlab.confdroid.com/12WW1160/cd_resources) for yum repo resources.
* [cd_resources](https://sourcecode.confdroid.com/12WW1160/cd_resources) for yum repo resources.
### Deployment
@@ -81,8 +78,8 @@ All files and directories are configured with correct selinux context. If selinu
### Support
* OS: CentOS 6, 7
* Puppet 3.x
* OS: CentOS 7
* Puppet 5.x
### Tests