Skip to content

Commit

Permalink
Merge branch 'release/v0.3.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jelemux authored and cesmarvin committed Dec 7, 2023
2 parents 29f2304 + 9c632f0 commit 66577d3
Showing 1 changed file with 28 additions and 29 deletions.
57 changes: 28 additions & 29 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ git.committerEmail = 'cesmarvin@cloudogu.com'
gitflow = new GitFlow(this, git)
github = new GitHub(this, git)
changelog = new Changelog(this)
Docker docker = new Docker(this)
gpg = new Gpg(this, docker)
goVersion = "1.21"
makefile = new Makefile(this)

Expand Down Expand Up @@ -47,32 +45,31 @@ node('docker') {
}

new Docker(this)
.image("golang:${goVersion}")
.mountJenkinsUser()
.inside("--volume ${WORKSPACE}:/go/src/${project} -w /go/src/${project}")
{
stage('Build') {
make 'build-job'
}

stage("Unit test") {
make 'unit-test'
junit allowEmptyResults: true, testResults: 'target/unit-tests/*-tests.xml'
}

stage("Review dog analysis") {
stageStaticAnalysisReviewDog()
}

stage('Generate k8s Resources') {
make 'helm-generate'
archiveArtifacts "${helmTargetDir}/**/*"
}

stage("Lint helm") {
make 'helm-lint'
}
}
.image("golang:${goVersion}")
.mountJenkinsUser()
.inside("--volume ${WORKSPACE}:/go/src/${project} -w /go/src/${project}") {
stage('Build') {
make 'build-job'
}

stage("Unit test") {
make 'unit-test'
junit allowEmptyResults: true, testResults: 'target/unit-tests/*-tests.xml'
}

stage("Review dog analysis") {
stageStaticAnalysisReviewDog()
}

stage('Generate k8s Resources') {
make 'helm-generate'
archiveArtifacts "${helmTargetDir}/**/*"
}

stage("Lint helm") {
make 'helm-lint'
}
}

stage('SonarQube') {
stageStaticAnalysisSonarQube()
Expand Down Expand Up @@ -128,6 +125,7 @@ void stageStaticAnalysisSonarQube() {
def qGate = waitForQualityGate()
if (qGate.status != 'OK') {
unstable("Pipeline unstable due to SonarQube quality gate failure")
unstable("Pipeline unstable due to SonarQube quality gate failure")
}
}
}
Expand All @@ -139,6 +137,7 @@ void stageAutomaticRelease() {
String controllerVersion = makefile.getVersion()

stage('Build & Push Image') {
Docker docker = new Docker(this)
def dockerImage = docker.build("cloudogu/${repositoryName}:${dockerReleaseVersion}")
docker.withRegistry('https://registry.hub.docker.com/', 'dockerHubCredentials') {
dockerImage.push("${dockerReleaseVersion}")
Expand All @@ -150,7 +149,7 @@ void stageAutomaticRelease() {
}

stage('Push Helm chart to Harbor') {
docker
new Docker(this)
.image("golang:${goVersion}")
.mountJenkinsUser()
.inside("--volume ${WORKSPACE}:/go/src/${project} -w /go/src/${project}") {
Expand Down

0 comments on commit 66577d3

Please sign in to comment.