-
Notifications
You must be signed in to change notification settings - Fork 9
/
Jenkinsfile
29 lines (24 loc) · 912 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env groovy
node('rhel7') {
def javaHome = tool 'openjdk-17'
env.JAVA_HOME = "${javaHome}"
stage('Checkout repo') {
deleteDir()
git url: 'https://github.com/redhat-developer/intellij-common-ui-test-library',
branch: "${sha1}"
}
def props = readProperties file: 'gradle.properties'
def isSnapshot = props['projectVersion'].contains('-SNAPSHOT')
stage('Build') {
sh "./gradlew build"
}
stage('Deploy') {
withCredentials([usernamePassword(credentialsId: 'Nexus-IJ-Credentials', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) {
if (isSnapshot) {
sh './gradlew publish -PnexusUser=$USER -PnexusPassword=$PASSWORD'
} else {
sh './gradlew publish closeAndReleaseStagingRepositories -PnexusUser=$USER -PnexusPassword=$PASSWORD'
}
}
}
}