@@ -5,27 +5,11 @@ pipeline {
55
66 environment {
77 VersionPrefix = ' 2.0.0'
8- VersionSuffix = ' rc.7 ' + " +${ BUILD_NUMBER} "
8+ VersionSuffix = ' rc.8 ' + " +${ BUILD_NUMBER} "
99 outputEnc = ' 65001'
1010 }
1111
1212 stages {
13- // stage('Prepare Linux Environment') {
14- // agent{ label 'master'}
15- // steps{
16- // dir('install'){
17- // sh 'chmod +x make-dockers.sh && ./make-dockers.sh'
18- // }
19- // withCredentials([usernamePassword(credentialsId: 'docker-hub', passwordVariable: 'dockerpassword', usernameVariable: 'dockeruser')]) {
20- // sh """
21- // docker login -p $dockerpassword -u $dockeruser
22- // docker push oscript/onescript-builder:deb
23- // docker push oscript/onescript-builder:rpm
24- // docker push oscript/onescript-builder:gcc
25- // """.stripIndent()
26- // }
27- // }
28- // }
2913 stage(' Build' ){
3014 parallel {
3115 stage(' Windows Build' ) {
@@ -206,16 +190,8 @@ pipeline {
206190 xcopy output\\ na-proxy\\ *64.so built\\ linux-x64\\ bin\\ /F
207191 ''' . stripIndent()
208192
209- script
210- {
211- if (env. BRANCH_NAME == " preview" ) {
212- echo ' Building preview'
213- bat " chcp $outputEnc > nul\r\n\" ${ tool 'MSBuild'} \" Build.csproj /t:PackDistributions /p:Suffix=-pre%BUILD_NUMBER%"
214- }
215- else {
216- bat " chcp $outputEnc > nul\r\n\" ${ tool 'MSBuild'} \" Build.csproj /t:PackDistributions"
217- }
218- }
193+ bat " chcp $outputEnc > nul\r\n\" ${ tool 'MSBuild'} \" Build.csproj /t:PackDistributions"
194+
219195 archiveArtifacts artifacts : ' built/**' , fingerprint : true
220196 stash includes : ' built/**' , name : ' dist'
221197 }
@@ -263,6 +239,7 @@ pipeline {
263239 }
264240
265241 steps {
242+ cleanWs()
266243 checkout scm
267244 unstash ' dist'
268245 unstash ' vsix'
@@ -280,41 +257,18 @@ pipeline {
280257 ''' . stripIndent()
281258 }
282259
283- sh '''
284- TARGET_DIR="/var/www/oscript.io/markdown/versions/"
285- cp install/release-notes.md "${TARGET_DIR}/${CODENAME}.md"
286- cp install/release-notes.md "${TARGET_DIR}/${VersionPrefix}.md"
287- ''' . stripIndent()
288- }
289- }
290-
291- stage (' Publishing latest' ) {
292- when { anyOf {
293- branch ' release/latest' ;
294- }
295- }
296- agent { label ' master' }
297- options { skipDefaultCheckout() }
260+ dir(' markdownContent' ) {
261+ script {
262+ def version= " ${ env.VersionPrefix} -${ env.VersionSuffix} " . replaceAll(" \. " , " _" )
263+ def targetDir= ' /var/www/oscript.io/markdown/versions'
298264
299- environment {
300- CODENAME = ' preview'
301- }
302-
303- steps {
304- checkout scm
305- unstash ' dist'
306- unstash ' vsix'
307-
308- dir(' targetContent' ) {
309- sh '''
310- ZIPS=../built
311- VSIX=../built/vscode
312- mv $ZIPS/*.zip ./
313- mv $VSIX/*.vsix ./
314-
315- TARGET="/var/www/oscript.io/download/versions/latest/"
316- sudo rsync -rv --delete --exclude mddoc*.zip --exclude *.src.rpm . $TARGET
317- ''' . stripIndent()
265+ sh """
266+ cp ../install/release-notes.md "./${ env.CODENAME} .md"
267+ cp ../install/release-notes.md "./${ version} .md"
268+
269+ sudo rsync -rv . ${ targetDir}
270+ """ . stripIndent()
271+ }
318272 }
319273 }
320274 }
@@ -330,7 +284,9 @@ pipeline {
330284 agent { label ' windows' }
331285
332286 steps{
333- unstash ' dist'
287+
288+ unstash ' buildResults'
289+
334290 withCredentials([string(credentialsId : ' NuGetToken' , variable : ' NUGET_TOKEN' )]) {
335291 bat " chcp $outputEnc > nul\r\n\" ${ tool 'MSBuild'} \" Build.csproj /t:PublishNuget /p:NugetToken=$NUGET_TOKEN "
336292 }
0 commit comments