Created
January 23, 2020 12:23
-
-
Save indranil32/b36450f33a94a8f2ea51f4f9bbece0ff to your computer and use it in GitHub Desktop.
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
stage('Upload APK to internal Nexus') { | |
environment { | |
// the creds your Jenkins use to communicate with your nexus | |
JENKINS_USER_CREDS = credentials('jenkins-user-password') | |
ENV_NAME = "${env.BRANCH_NAME}" | |
} | |
when { | |
anyOf { | |
// choose what kinds of builds you want to arhive in your nexus | |
branch 'develop'; | |
tag "*" | |
} | |
} | |
steps { | |
echo 'Publishing Branch: ' + ENV_NAME | |
dir("${env.WORKSPACE}/android") { | |
sh 'chmod +x ./gradlew' | |
sh "./gradlew publish -PuploadRepoUsername=$JENKINS_USER_CREDS_USR -PuploadRepoPassword=$JENKINS_USER_CREDS_PSW -PuploadBuildNumber=${env.BUILD_NUMBER}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment