Modify Dockerfile & Jenkinsfile

pull/9/head
Hammy 3 years ago
parent 17cf0c8dce
commit 4a58dacfbc

@ -1,9 +1,5 @@
FROM maven:3.8.1-adoptopenjdk-11 FROM maven:3.8.1-adoptopenjdk-11
MAINTAINER Goudham Suresh MAINTAINER Goudham Suresh
RUN ls -la RUN apt-get update && apt-get install -y \
gpg
RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get -y dist-upgrade && \
apt-get -y install gpg

42
Jenkinsfile vendored

@ -21,25 +21,34 @@ pipeline {
stages { stages {
stage("Import GPG Keys") { stage("Import GPG Keys") {
steps { steps {
sh """ sh 'gpg --batch --import $GPG_SECRET_KEY'
gpg --batch --import ${GPG_SECRET_KEY} sh 'gpg --import-ownertrust $GPG_OWNER_TRUST'
gpg --import-ownertrust ${GPG_OWNER_TRUST}
"""
} }
} }
stage("Building") { stage("Build") {
steps { steps {
withCredentials([file(credentialsId: '076a36e8-d448-46fc-af11-7e7181a6cb99', variable: 'MAVEN_SETTINGS')]) { withCredentials([file(credentialsId: '076a36e8-d448-46fc-af11-7e7181a6cb99', variable: 'MAVEN_SETTINGS')]) {
sh 'mvn -s $MAVEN_SETTINGS -B -DskipTests clean install' sh 'mvn -s $MAVEN_SETTINGS -B -DskipTests clean package'
} }
} }
} }
stage("Testing") { stage("Test") {
steps { steps {
sh "mvn test" sh "mvn test"
} }
post {
success {
echo "Generating Test Report..."
publishCoverage adapters: [jacocoAdapter('target/site/jacoco/jacoco.xml')]
echo "Sending Report to CodeCov..."
sh '''#!/bin/bash
bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN || echo "Codecov did not collect coverage reports"
'''
}
}
} }
stage("Deploying To Nexus") { stage("Deploy To Nexus") {
when { when {
branch 'release' branch 'release'
} }
@ -77,23 +86,18 @@ pipeline {
} }
} }
} }
post {
success {
echo "Archiving Artifacts"
archiveArtifacts artifacts: 'target/*.jar'
}
}
} }
} }
post { post {
success { success {
echo "I'm Feeling Swag!" echo "I'm Feeling Swag!"
echo "Archiving Artifacts"
archiveArtifacts artifacts: 'target/*.jar'
echo "Generating Test Report..."
publishCoverage adapters: [jacocoAdapter('target/site/jacoco/jacoco.xml')]
echo "Sending Report to CodeCov..."
sh '''#!/bin/bash
bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN || echo "Codecov did not collect coverage reports"
'''
} }
failure { failure {
echo 'Not Very Swag :(' echo 'Not Very Swag :('

Loading…
Cancel
Save