Skip to content

Commit

Permalink
Merge branch 'ust_25919/rework_the_jenkinsfile_of_the_repo_pr'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins CI committed Dec 2, 2024
2 parents 8e3f6b8 + 5566dd2 commit 925259e
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 25 deletions.
86 changes: 61 additions & 25 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,74 @@ import org.gradiant.jenkins.slack.SlackNotifier

pipeline {
agent none

stages {
stage('Tests') {
parallel {
stage('shell') {
agent { label 'script' }
steps {
sh script: 'typos', label: 'check typos'
sh script: './qa-test --shell', label: 'shell scripts lint'
stage('typos') {
agent {
dockerfile {
filename 'ci/typos.Dockerfile'
}
steps {
sh script: 'typos', label: 'check typos'
}
post {
failure {
script {
errors.add("check typos")
slackResponse = updateSlack(errors, running, slackResponse, version, changeUrl)
slackSend(channel: slackResponse.threadId, message: "Check typos on all plugins failed - <${currentBuild.absoluteUrl}console|Console>", color: "#CC3421")
}
}
post {
always {
// linters results
recordIssues enabledForFailure: true, failOnError: true, sourceCodeEncoding: 'UTF-8',
tool: checkStyle(pattern: '.shellcheck/*.log', reportEncoding: 'UTF-8', name: 'Shell scripts')

script {
new SlackNotifier().notifyResult("shell-team")
}
cleanup {
script {
running.remove("check typos")
}
}
}
stage('python') {
agent { label 'script' }
steps {
sh script: './qa-test --python', label: 'python scripts lint'
}
stage('shellcheck') {
agent {
dockerfile {
filename 'ci/shellcheck.Dockerfile'
}
steps {
sh script: './qa-test --shell', label: 'shellcheck'
}
post {
always {
// linters results
recordIssues enabledForFailure: true, failOnError: true, sourceCodeEncoding: 'UTF-8',
tool: checkStyle(pattern: '.shellcheck/*.log', reportEncoding: 'UTF-8', name: 'Shell scripts')
}
failure {
script {
errors.add("shell scripts")
slackResponse = updateSlack(errors, running, slackResponse, version, changeUrl)
slackSend(channel: slackResponse.threadId, message: "Check shell scripts on all plugins failed - <${currentBuild.absoluteUrl}console|Console>", color: "#CC3421")
}
}
}
}
stage('python') {
agent {
dockerfile {
filename 'ci/pylint.Dockerfile'
}
}
steps {
sh script: './qa-test --python', label: 'python scripts lint'
}
post {
failure {
script {
errors.add("python scripts")
slackResponse = updateSlack(errors, running, slackResponse, version, changeUrl)
slackSend(channel: slackResponse.threadId, message: "Check python scripts on all plugins failed - <${currentBuild.absoluteUrl}console|Console>", color: "#CC3421")
}
}
post {
always {
script {
new SlackNotifier().notifyResult("shell-team")
}
cleanup {
script {
running.remove("python scripts")
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions ci/shellcheck.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM debian:12
LABEL ci=rudder/ci/shellcheck.Dockerfile

RUN apt-get update && apt-get install -y shellcheck
5 changes: 5 additions & 0 deletions ci/typos.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM rust:1.74.0
LABEL ci=rudder/ci/typos.Dockerfile
ARG VERSION

RUN cargo install -f typos-cli --locked --version =$VERSION
7 changes: 7 additions & 0 deletions ci/user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

# Jenkins user with correct uid
USER_ID=$1
mkdir /home/jenkins
useradd -r -u $USER_ID -d /home/jenkins jenkins
chown jenkins /home/jenkins

0 comments on commit 925259e

Please sign in to comment.