Skip to content

Commit

Permalink
Update Jenkins file to push jar in artifactory
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Rossier, INI-DNA-DL committed Nov 9, 2020
1 parent e664c87 commit e96917b
Showing 1 changed file with 58 additions and 7 deletions.
65 changes: 58 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,58 @@
#!/usr/bin/env groovy
common {
slackChannel = '#connect-warn'
upstreamProjects = 'confluentinc/common'
pintMerge = true
downStreamValidate = false
}
pipeline {
agent {
node {
label 'docker'
}
}

environment {
IMAGE_TAG = readMavenPom().getVersion()
REGISTRY_URL = "https://io-docker.artifactory.swisscom.com"
REGISTRY_CREDENTIALS_ID = "artifactory"
}

stages {

stage('Build jars') {
agent {
docker {
reuseNode true
image 'io-docker.artifactory.swisscom.com/maven:3.6.0'
registryUrl env.REGISTRY_URL
registryCredentialsId env.REGISTRY_CREDENTIALS_ID
}
}
steps {
withMaven(maven: 'Maven', mavenLocalRepo: '.repository', globalMavenSettingsConfig: "maven-settings") {
sh 'export PATH=$MVN_CMD_DIR:$PATH && mvn clean package'
}
}
}

stage('Deploy jars') {
agent {
docker {
reuseNode true
image 'io-docker.artifactory.swisscom.com/maven:3.6.0'
registryUrl env.REGISTRY_URL
registryCredentialsId env.REGISTRY_CREDENTIALS_ID
}
}
steps {
withMaven(maven: 'Maven', mavenLocalRepo: '.repository', globalMavenSettingsConfig: "maven-settings") {
sh 'export PATH=$MVN_CMD_DIR:$PATH && mvn deploy'
}
}
}
}

post {
failure {
emailext(
subject: '${DEFAULT_SUBJECT}',
recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']],
body: '${DEFAULT_CONTENT}'
)
}
}
}

0 comments on commit e96917b

Please sign in to comment.