Skip to content

Commit e032c20

Browse files
committed
Replace rsync calls with sftp in Jenkinsfile deployment
- Upload entire folder recursively rather than iterating through files Signed-off-by: Roland Grunberg <[email protected]>
1 parent 81eafc3 commit e032c20

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Jenkinsfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,11 @@ node('rhel8'){
7070
stash name:'platformVsix', includes:'java-win32-*.vsix,java-linux-*.vsix,java-darwin-*.vsix'
7171

7272
stage 'Upload vscode-java to staging'
73-
def artifacts = findFiles(glob: '**.vsix')
7473
def artifactDir = "java-${env.EXTENSION_VERSION}-${env.BUILD_NUMBER}"
7574
sh "mkdir ${artifactDir}"
7675
sh "mv *.vsix ${artifactDir}"
7776

78-
for(artifact in artifacts){
79-
sh "rsync -Pzrlt --rsh=ssh --protocol=28 --relative ${artifactDir}/${artifact.path} ${UPLOAD_LOCATION}/jdt.ls/staging"
80-
}
77+
sh "sftp ${UPLOAD_LOCATION}/jdt.ls/staging <<< \$'mkdir ${artifactDir}\nput -r ${artifactDir}'"
8178
// Clean up build vsix
8279
sh "rm -rf ${artifactDir}"
8380
}
@@ -114,16 +111,13 @@ node('rhel8'){
114111
}
115112

116113
stage "Publish to http://download.jboss.org/jbosstools/static/jdt.ls/stable/"
117-
def artifacts = findFiles(glob: '**.vsix')
118114
def artifactDir = "java-${env.EXTENSION_VERSION}"
119115
sh "mkdir ${artifactDir}"
120116
sh "mv *.vsix ${artifactDir}"
121117

122118
archive includes:"${artifactDir}/**/*.*"
123119

124120
// copy this stable build to Akamai-mirrored /static/ URL, so staging can be cleaned out more easily
125-
for(artifact in artifacts){
126-
sh "rsync -Pzrlt --rsh=ssh --protocol=28 --relative ${artifactDir}/${artifact.path} ${UPLOAD_LOCATION}/static/jdt.ls/stable/"
127-
}
121+
sh "sftp ${UPLOAD_LOCATION}/static/jdt.ls/stable/ <<< \$'mkdir ${artifactDir}\nput -r ${artifactDir}'"
128122
}// if publishToMarketPlace
129123
}

0 commit comments

Comments
 (0)