Created
May 30, 2019 16:08
-
-
Save kenrachynski/3aef16f4f637e4967bc5012d86cd879c to your computer and use it in GitHub Desktop.
pipeline with authentication deploying wildfly application
This file contains hidden or 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 { | |
| label 'aws' | |
| } | |
| environment { | |
| JBOSSADMIN = credentials('jboss-admin') | |
| MAVEN_SETTINGS = credentials('maven-settings-windows') | |
| } | |
| tools { | |
| maven 'Maven35' | |
| jdk 'jdk-1.8.0-aws' | |
| } | |
| stages { | |
| stage('Build') { | |
| steps { | |
| checkout scm | |
| sh "mvn -s ${MAVEN_SETTINGS} -B -U -V clean deploy" | |
| } | |
| } | |
| stage('Deploy Development') { | |
| when { not { branch 'master' } } | |
| steps { | |
| sh """mvn -s ${MAVEN_SETTINGS} -B -U -V -Pdev wildfly:deploy \ | |
| -Dwildfly.username=${JBOSSADMIN_USR} \ | |
| -Dwildfly.password='${JBOSSADMIN_PSW}'""" | |
| } | |
| } | |
| stage('Deploy Production') { | |
| when { branch 'master' } | |
| parallel { | |
| stage('Release') { | |
| input { | |
| message "Permission to deploy to production server?" | |
| } | |
| steps { | |
| sh """mvn -s ${MAVEN_SETTINGS} -B -U -V -Pprod wildfly:deploy \ | |
| -Dwildfly.username=${JBOSSADMIN_USR} \ | |
| -Dwildfly.password='${JBOSSADMIN_PSW}'""" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| post { | |
| always { sendNotifications currentBuild.currentResult } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment