Last active
April 22, 2021 03:51
-
-
Save robertobatts/42da9069e13b61a238f51c36754de97b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent any | |
triggers { | |
bitbucketPush() | |
} | |
tools { | |
jdk 'OpenJDK_1_8_0' | |
} | |
stages { | |
stage('Artifactory config') { | |
steps { | |
rtServer( | |
id: "server_tutorial", | |
url: "http://3.134.8.172:8081/artifactory", | |
credentialsId: "artifactory-credentials" | |
) | |
rtMavenDeployer( | |
id: "MAVEN_DEPLOYER", | |
serverId: "server_tutorial", | |
releaseRepo: "libs-release", | |
snapshotRepo: "libs-release" | |
) | |
} | |
} | |
stage('Build Maven') { | |
steps { | |
configFileProvider([configFile(fileId: 'MavenArtifactorySettingId', variable: 'MAVEN_SETTINGS_XML')]) { | |
retry(count: 3) { | |
rtMavenRun( | |
tool: "Maven 3.6.2",//Tool name from Jenkins configuration | |
pom: 'pom.xml', | |
goals: '-U -s $MAVEN_SETTINGS_XML clean install', | |
deployerId: "MAVEN_DEPLOYER" | |
) | |
} | |
} | |
} | |
} | |
stage('Publish to Artifactory') { | |
steps { | |
rtPublishBuildInfo(serverId: "server_tutorial") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment