Compare commits

...

3 Commits

Author SHA1 Message Date
Jenkins Server
6e5697833d Merge remote-tracking branch 'origin/master' into jenkins-build-10 2026-09-06 15:53:25 +02:00
f883424e26 fix template 2026-09-06 15:52:06 +02:00
Jenkins Server
7225773a25 Recommit for updates in build 9 2026-09-01 11:36:07 +02:00
3 changed files with 66 additions and 133 deletions

127
Jenkinsfile vendored
View File

@@ -1,127 +0,0 @@
pipeline {
agent {
label 'puppet'
}
post {
always {
deleteDir() /* clean up our workspace */
}
success {
updateGitlabCommitStatus state: 'success'
}
failure {
updateGitlabCommitStatus state: 'failed'
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'support@confdroid.com', sendToIndividuals: true])
}
}
options {
gitLabConnection('gitlab.confdroid.com')
}
stages {
stage('pull master') {
steps {
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
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; }
'''
}
}
}
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 '''/usr/local/bin/puppet-lint . \\
--no-variable_scope-check \\
|| { echo "Puppet lint failed"; exit 1; }
'''
}
}
stage('SonarScan') {
steps {
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
sh '''
/opt/sonar-scanner/bin/sonar-scanner \
-Dsonar.projectKey=confdroid_alloy \
-Dsonar.sources=. \
-Dsonar.host.url=https://sonarqube.confdroid.com \
-Dsonar.token=$SONAR_TOKEN
'''
}
}
}
stage('create Puppet documentation') {
steps {
sh '/opt/puppetlabs/bin/puppet strings'
}
}
stage('update repo') {
steps {
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
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 {
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
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_alloy.git
git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \
push master --mirror
'''
}
}
}
}
}
}
}

View File

@@ -302,6 +302,60 @@
—
<div class='inline'>
<p>whether to track timestamps staleness in prometheus metrics</p>
</div>
</li>
<li>
<span class='name'>ay_prom_max_shards</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;10&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the maximum number of shards to use for prometheus metrics</p>
</div>
</li>
<li>
<span class='name'>ay_prom_max_samples_per_send</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;2000&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the maximum number of samples to send</p>
</div>
</li>
<li>
<span class='name'>ay_prom_batch_send_deadline</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;5s&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the maximum time to wait before sending</p>
</div>
</li>
@@ -317,9 +371,6 @@
<pre class="lines">
19
20
21
22
23
24
@@ -347,10 +398,16 @@
46
47
48
49</pre>
49
50
51
52
53
54
55</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 19</span>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 22</span>
class confdroid_alloy::params (
@@ -369,6 +426,9 @@ class confdroid_alloy::params (
String $ay_prom_url = &#39;https://prometheus.example.net/api/v1/write&#39;,
Boolean $ay_prom_honor_timestamps = true,
Boolean $ay_prom_track_timestamps_staleness = true,
String $ay_prom_max_shards = &#39;10&#39;,
String $ay_prom_max_samples_per_send = &#39;2000&#39;,
String $ay_prom_batch_send_deadline = &#39;5s&#39;,
) {
# service

View File

@@ -97,7 +97,7 @@ prometheus.remote_write "prometheus" {
queue_config {
max_shards = <%= @ay_prom_max_shards %>
max_samples_per_send = <%= @ay_prom_max_samples_per_send %>
batch_send_deadline = <%= @ay_prom_batch_send_deadline %>
batch_send_deadline = "<%= @ay_prom_batch_send_deadline %>"
}
}
}