Compare commits
5 Commits
1.0.0
...
3eed4ba4fe
| Author | SHA1 | Date | |
|---|---|---|---|
| 3eed4ba4fe | |||
| 1af997a6d5 | |||
| adbced0d81 | |||
|
|
7d84294e7d | ||
|
|
a923dadb8d |
29
.gitignore
vendored
29
.gitignore
vendored
@@ -3,3 +3,32 @@
|
|||||||
Gemfile.lock
|
Gemfile.lock
|
||||||
FileList
|
FileList
|
||||||
.scannerwork
|
.scannerwork
|
||||||
|
.vscode
|
||||||
|
.idea
|
||||||
|
*.log
|
||||||
|
*.tmp
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*.bak
|
||||||
|
*.backup
|
||||||
|
*.orig
|
||||||
|
*.rej
|
||||||
|
*.sublime-project
|
||||||
|
*.sublime-workspace
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
*.gem
|
||||||
|
*.rbc
|
||||||
|
.bundle
|
||||||
|
vendor/bundle
|
||||||
|
vendor/cache
|
||||||
|
vendor/gems
|
||||||
|
vendor/ruby
|
||||||
|
log/*
|
||||||
|
tmp/*
|
||||||
|
!.keep
|
||||||
|
coverage/*
|
||||||
|
spec/reports/*
|
||||||
|
test/reports/*
|
||||||
|
doc/*
|
||||||
|
pkg/*
|
||||||
|
|||||||
74
Jenkinsfile
vendored
74
Jenkinsfile
vendored
@@ -1,7 +1,5 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent any
|
||||||
label 'puppet'
|
|
||||||
}
|
|
||||||
|
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
@@ -25,10 +23,16 @@ pipeline {
|
|||||||
stage('pull master') {
|
stage('pull master') {
|
||||||
steps {
|
steps {
|
||||||
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
|
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
|
||||||
sh '''git config user.name "Jenkins Server"
|
sh '''
|
||||||
git config user.email jenkins@confdroid.com
|
git config user.name "Jenkins Server"
|
||||||
git pull origin master
|
git config user.email jenkins@confdroid.com
|
||||||
git checkout -b jenkins '''
|
# Ensure we're on the development branch (triggered by push)
|
||||||
|
git checkout development
|
||||||
|
# Create jenkins branch from development
|
||||||
|
git checkout -b jenkins-build-$BUILD_NUMBER
|
||||||
|
# Optionally merge master into jenkins to ensure compatibility
|
||||||
|
git merge origin/master --no-ff || { echo "Merge conflict detected"; exit 1; }
|
||||||
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,20 +57,23 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
sh '''/usr/local/bin/puppet-lint . \\
|
sh '''/usr/local/bin/puppet-lint . \\
|
||||||
--no-variable_scope-check \\
|
--no-variable_scope-check \\
|
||||||
|
|| { echo "Puppet lint failed"; exit 1; }
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('SonarScan') {
|
stage('SonarScan') {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
|
||||||
/opt/sonar-scanner/bin/sonar-scanner \
|
sh '''
|
||||||
-Dsonar.projectKey=php_cd \
|
/opt/sonar-scanner/bin/sonar-scanner \
|
||||||
-Dsonar.sources=. \
|
-Dsonar.projectKey=confdroid_php \
|
||||||
-Dsonar.host.url=https://sonarqube.confdroid.com \
|
-Dsonar.sources=. \
|
||||||
-Dsonar.token=sqa_aca21cc41336d0f31987ed196ccfb9be55ded774
|
-Dsonar.host.url=https://sonarqube.confdroid.com \
|
||||||
'''
|
-Dsonar.token=$SONAR_TOKEN
|
||||||
}
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('create Puppet documentation') {
|
stage('create Puppet documentation') {
|
||||||
@@ -78,12 +85,39 @@ pipeline {
|
|||||||
stage('update repo') {
|
stage('update repo') {
|
||||||
steps {
|
steps {
|
||||||
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
|
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
|
||||||
sh '''git config user.name "Jenkins Server"
|
sh '''
|
||||||
git config user.email jenkins@confdroid.com
|
git config user.name "Jenkins Server"
|
||||||
echo `git add -A && git commit -am "recommit for updates in build $BUILD_NUMBER"`
|
git config user.email jenkins@confdroid.com
|
||||||
git push origin HEAD:master'''
|
git rm -r --cached .vscode || echo "No .vscode to remove from git"
|
||||||
|
git add -A && git commit -am "Recommit for updates in build $BUILD_NUMBER" || echo "No changes to commit"
|
||||||
|
git push origin HEAD:master
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Mirror to Gitea') {
|
||||||
|
steps {
|
||||||
|
withCredentials([usernamePassword(
|
||||||
|
credentialsId: 'Jenkins-gitea',
|
||||||
|
usernameVariable: 'GITEA_USER',
|
||||||
|
passwordVariable: 'GITEA_TOKEN')]) {
|
||||||
|
script {
|
||||||
|
// Checkout from GitLab (already done implicitly)
|
||||||
|
sh '''
|
||||||
|
git checkout master
|
||||||
|
git pull origin master
|
||||||
|
git branch -D development
|
||||||
|
git branch -D jenkins-build-$BUILD_NUMBER
|
||||||
|
git rm -f Jenkinsfile
|
||||||
|
git rm -r --cached .vscode || echo "No .vscode to remove from git"
|
||||||
|
git commit --amend --no-edit --allow-empty
|
||||||
|
git remote add master https://sourcecode.confdroid.com/confdroid/confdroid_php.git
|
||||||
|
git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \
|
||||||
|
push master --mirror
|
||||||
|
'''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
24
README.md
24
README.md
@@ -1,14 +1,27 @@
|
|||||||
# Readme
|
# Readme
|
||||||
|
|
||||||
[](https://pipelines.confdroid.com/job/php_cd/)|
|
[](https://jenkins.confdroid.com/job/confdroid_php/)
|
||||||
|
[](https://sonarqube.confdroid.com/dashboard?id=confdroid_php)
|
||||||
|
[](https://sonarqube.confdroid.com/dashboard?id=confdroid_php)
|
||||||
|
|
||||||
|
|
||||||
|
- [Readme](#readme)
|
||||||
|
- [Synopsis](#synopsis)
|
||||||
|
- [WARNING](#warning)
|
||||||
|
- [Features](#features)
|
||||||
|
- [Support](#support)
|
||||||
|
- [Parameter Inheritance](#parameter-inheritance)
|
||||||
|
- [Module Deployment](#module-deployment)
|
||||||
|
- [Tests](#tests)
|
||||||
|
- [Contact Us](#contact-us)
|
||||||
|
- [Disclaimer](#disclaimer)
|
||||||
|
|
||||||
[[_TOC_]]
|
|
||||||
|
|
||||||
## Synopsis
|
## Synopsis
|
||||||
|
|
||||||
Php is a widely used open source scripting language for web services.
|
Php is a widely used open source scripting language for web services.
|
||||||
|
|
||||||
`php_cd` manages php installations for use with other modules like `wordpress_cd`
|
`confdroid_php` manages plain php installations for use with other modules like `confdroid_nagios`. PHP is installed and properly configured to allow multiple applications with different settings to run in parallel. Custom php.ini settings should be configured with the application in question.
|
||||||
|
|
||||||
## WARNING
|
## WARNING
|
||||||
|
|
||||||
@@ -16,6 +29,11 @@ Php is a widely used open source scripting language for web services.
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
- install php
|
||||||
|
- manage required directories including selinux contexts and permissions
|
||||||
|
- manage reuired files including selinux contexts and permissions
|
||||||
|
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
* Rocky 9
|
* Rocky 9
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
## php_cd::init.pp
|
## confdroid_php::init.pp
|
||||||
# Module name: php_cd
|
# Module name: confdroid_php
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||||
# @summary Class initializes the php_cd module
|
# @summary Class initializes the confdroid_php module
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class php_cd {
|
class confdroid_php {
|
||||||
include php_cd::params
|
include confdroid_php::params
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
## php_cd::main::config.pp
|
## confdroid_php::main::config.pp
|
||||||
# Module name: php_cd
|
# Module name: confdroid_php
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||||
# @summary Class manages the module logic
|
# @summary Class manages the module logic
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class php_cd::main::config (
|
class confdroid_php::main::config (
|
||||||
|
|
||||||
) inherits php_cd::params {
|
) inherits confdroid_php::params {
|
||||||
include php_cd::main::files
|
include confdroid_php::main::files
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
## php_cd::main::dirs.pp
|
## confdroid_php::main::dirs.pp
|
||||||
# Module name: php_cd
|
# Module name: confdroid_php
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||||
# @summary Class manages directory structure
|
# @summary Class manages directory structure
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class php_cd::main::dirs (
|
class confdroid_php::main::dirs (
|
||||||
|
|
||||||
) inherits php_cd::params {
|
) inherits confdroid_php::params {
|
||||||
require php_cd::main::install
|
require confdroid_php::main::install
|
||||||
|
|
||||||
file { $php_lib_dir:
|
file { $php_lib_dir:
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
## php_cd::main::files.pp
|
## confdroid_php::main::files.pp
|
||||||
# Module name: php_cd
|
# Module name: confdroid_php
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||||
# @summary Class manages file aspects
|
# @summary Class manages file aspects
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class php_cd::main::files (
|
class confdroid_php::main::files (
|
||||||
|
|
||||||
) inherits php_cd::params {
|
) inherits confdroid_php::params {
|
||||||
require php_cd::main::dirs
|
require confdroid_php::main::dirs
|
||||||
|
|
||||||
file { $php_ini_file:
|
file { $php_ini_file:
|
||||||
ensure => file,
|
ensure => file,
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
## php_cd::main::install.pp
|
## confdroid_php::main::install.pp
|
||||||
# Module name: php_cd
|
# Module name: confdroid_php
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||||
# @summary Class manages installation aspects
|
# @summary Class manages installation aspects
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class php_cd::main::install (
|
class confdroid_php::main::install (
|
||||||
|
|
||||||
) inherits php_cd::params {
|
) inherits confdroid_php::params {
|
||||||
package { $reqpackages:
|
package { $reqpackages:
|
||||||
ensure => $pkg_ensure,
|
ensure => $pkg_ensure,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
## php_cd::params.pp
|
## confdroid_php::params.pp
|
||||||
# Module name: php_cd
|
# Module name: confdroid_php
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||||
# @summary Class contains all class parameters for this module
|
# @summary Class contains all class parameters for this module
|
||||||
# @param [String] reqpackages which packages to install
|
# @param [String] reqpackages which packages to install
|
||||||
# @param [String] pkg_ensure which version of packages to install
|
# @param [String] pkg_ensure which version of packages to install
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class php_cd::params (
|
class confdroid_php::params (
|
||||||
|
|
||||||
String $reqpackages = 'php',
|
String $reqpackages = 'php',
|
||||||
String $pkg_ensure = 'latest',
|
String $pkg_ensure = 'present',
|
||||||
|
|
||||||
) {
|
) {
|
||||||
# Facts
|
# Facts
|
||||||
@@ -26,8 +26,8 @@ class php_cd::params (
|
|||||||
|
|
||||||
# Files
|
# Files
|
||||||
$php_ini_file = '/etc/php.ini'
|
$php_ini_file = '/etc/php.ini'
|
||||||
$php_ini_erb = 'php_cd/php.ini.erb'
|
$php_ini_erb = 'confdroid_php/php.ini.erb'
|
||||||
|
|
||||||
# includes must be last
|
# includes must be last
|
||||||
include php_cd::main::config
|
include confdroid_php::main::config
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user