File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,43 @@ pipeline {
104
104
}
105
105
}
106
106
}
107
+ stage(' Branch Artifactory Deploy' ) {
108
+ options {
109
+ timeout(time : 5 , unit : ' MINUTES' )
110
+ }
111
+ when {
112
+ not {
113
+ anyOf {
114
+ branch " master"
115
+ branch " develop"
116
+ }
117
+ }
118
+ }
119
+ steps {
120
+ script {
121
+ getAndConfigureJFrogCLI()
122
+ if (env. GIT_URL ) {
123
+ repoName = (" ${ env.GIT_URL} " =~ / (.*\/ )(.*)(\. git)/ )[ 0 ][ 2 ]
124
+ findFiles(glob : ' target/*.jar' ). each { item ->
125
+ if (! (item ==~ / .*\/ fb-contrib-.*?.jar/ ) && ! (item ==~ / .*\/ findsecbugs-plugin-.*?.jar/ ) && ! (item ==~ / .*-sources.jar/ ) && ! (item ==~ / .*-javadoc.jar/ )) {
126
+ sh " ./jfrog rt u \" ${ item.path} \" branch-artifacts/${ env.BRANCH_NAME} /${ repoName} /java/ --recursive=false --build-name ${ env.BRANCH_NAME} --build-number ${ env.BUILD_NUMBER} --props \" vcs.revision=${ env.GIT_COMMIT} ;repo.name=${ repoName} \" "
127
+ }
128
+ }
129
+ findFiles(glob : ' **/pom.xml' ). each { item ->
130
+ def pomPath = item. path. replace(' \\ ' ,' /' )
131
+ if (! (pomPath ==~ / .*target.*/ )) {
132
+ def resPomName = " main.pom"
133
+ def subDirMatcher = (pomPath =~ / ^.*(?<=\/ |^)(.*)\/ pom\. xml/ )
134
+ if (subDirMatcher. matches()) {
135
+ resPomName = " ${ subDirMatcher[ 0 ][ 1 ]} .pom"
136
+ }
137
+ sh " ./jfrog rt u \" ${ item.path} \" branch-artifacts/${ env.BRANCH_NAME} /${ repoName} /java/${ resPomName} --recursive=false --build-name ${ env.BRANCH_NAME} --build-number ${ env.BUILD_NUMBER} --props \" vcs.revision=${ env.GIT_COMMIT} ;repo.name=${ repoName} \" "
138
+ }
139
+ }
140
+ }
141
+ }
142
+ }
143
+ }
107
144
stage(' Archive Artifacts' ) {
108
145
options {
109
146
timeout(time : 5 , unit : ' MINUTES' )
You can’t perform that action at this time.
0 commit comments