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
|
||||
FileList
|
||||
.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 {
|
||||
agent {
|
||||
label 'puppet'
|
||||
}
|
||||
agent any
|
||||
|
||||
post {
|
||||
always {
|
||||
@@ -25,10 +23,16 @@ pipeline {
|
||||
stage('pull master') {
|
||||
steps {
|
||||
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
|
||||
sh '''git config user.name "Jenkins Server"
|
||||
git config user.email jenkins@confdroid.com
|
||||
git pull origin master
|
||||
git checkout -b jenkins '''
|
||||
sh '''
|
||||
git config user.name "Jenkins Server"
|
||||
git config user.email jenkins@confdroid.com
|
||||
# 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 {
|
||||
sh '''/usr/local/bin/puppet-lint . \\
|
||||
--no-variable_scope-check \\
|
||||
|| { echo "Puppet lint failed"; exit 1; }
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('SonarScan') {
|
||||
steps {
|
||||
sh '''
|
||||
/opt/sonar-scanner/bin/sonar-scanner \
|
||||
-Dsonar.projectKey=php_cd \
|
||||
-Dsonar.sources=. \
|
||||
-Dsonar.host.url=https://sonarqube.confdroid.com \
|
||||
-Dsonar.token=sqa_aca21cc41336d0f31987ed196ccfb9be55ded774
|
||||
'''
|
||||
}
|
||||
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
|
||||
sh '''
|
||||
/opt/sonar-scanner/bin/sonar-scanner \
|
||||
-Dsonar.projectKey=confdroid_php \
|
||||
-Dsonar.sources=. \
|
||||
-Dsonar.host.url=https://sonarqube.confdroid.com \
|
||||
-Dsonar.token=$SONAR_TOKEN
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('create Puppet documentation') {
|
||||
@@ -78,12 +85,39 @@ pipeline {
|
||||
stage('update repo') {
|
||||
steps {
|
||||
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
|
||||
sh '''git config user.name "Jenkins Server"
|
||||
git config user.email jenkins@confdroid.com
|
||||
echo `git add -A && git commit -am "recommit for updates in build $BUILD_NUMBER"`
|
||||
git push origin HEAD:master'''
|
||||
sh '''
|
||||
git config user.name "Jenkins Server"
|
||||
git config user.email jenkins@confdroid.com
|
||||
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
|
||||
|
||||
[](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
|
||||
|
||||
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
|
||||
|
||||
@@ -16,6 +29,11 @@ Php is a widely used open source scripting language for web services.
|
||||
|
||||
## Features
|
||||
|
||||
- install php
|
||||
- manage required directories including selinux contexts and permissions
|
||||
- manage reuired files including selinux contexts and permissions
|
||||
|
||||
|
||||
## Support
|
||||
|
||||
* Rocky 9
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
## php_cd::init.pp
|
||||
# Module name: php_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
# @summary Class initializes the php_cd module
|
||||
## confdroid_php::init.pp
|
||||
# Module name: confdroid_php
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class initializes the confdroid_php module
|
||||
##############################################################################
|
||||
class php_cd {
|
||||
include php_cd::params
|
||||
class confdroid_php {
|
||||
include confdroid_php::params
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
## php_cd::main::config.pp
|
||||
# Module name: php_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
## confdroid_php::main::config.pp
|
||||
# Module name: confdroid_php
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages the module logic
|
||||
##############################################################################
|
||||
class php_cd::main::config (
|
||||
class confdroid_php::main::config (
|
||||
|
||||
) inherits php_cd::params {
|
||||
include php_cd::main::files
|
||||
) inherits confdroid_php::params {
|
||||
include confdroid_php::main::files
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
## php_cd::main::dirs.pp
|
||||
# Module name: php_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
## confdroid_php::main::dirs.pp
|
||||
# Module name: confdroid_php
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages directory structure
|
||||
##############################################################################
|
||||
class php_cd::main::dirs (
|
||||
class confdroid_php::main::dirs (
|
||||
|
||||
) inherits php_cd::params {
|
||||
require php_cd::main::install
|
||||
) inherits confdroid_php::params {
|
||||
require confdroid_php::main::install
|
||||
|
||||
file { $php_lib_dir:
|
||||
ensure => directory,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
## php_cd::main::files.pp
|
||||
# Module name: php_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
## confdroid_php::main::files.pp
|
||||
# Module name: confdroid_php
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class manages file aspects
|
||||
##############################################################################
|
||||
class php_cd::main::files (
|
||||
class confdroid_php::main::files (
|
||||
|
||||
) inherits php_cd::params {
|
||||
require php_cd::main::dirs
|
||||
) inherits confdroid_php::params {
|
||||
require confdroid_php::main::dirs
|
||||
|
||||
file { $php_ini_file:
|
||||
ensure => file,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
## php_cd::main::install.pp
|
||||
# Module name: php_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
## confdroid_php::main::install.pp
|
||||
# Module name: confdroid_php
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @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:
|
||||
ensure => $pkg_ensure,
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
## php_cd::params.pp
|
||||
# Module name: php_cd
|
||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
||||
## confdroid_php::params.pp
|
||||
# Module name: confdroid_php
|
||||
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||
# @summary Class contains all class parameters for this module
|
||||
# @param [String] reqpackages which 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 $pkg_ensure = 'latest',
|
||||
String $pkg_ensure = 'present',
|
||||
|
||||
) {
|
||||
# Facts
|
||||
@@ -26,8 +26,8 @@ class php_cd::params (
|
||||
|
||||
# Files
|
||||
$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
|
||||
include php_cd::main::config
|
||||
include confdroid_php::main::config
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user