File tree Expand file tree Collapse file tree 1 file changed +93
-0
lines changed
Expand file tree Collapse file tree 1 file changed +93
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ pipeline {
3+ agent none
4+ options {
5+ buildDiscarder(logRotator(numToKeepStr : ' 7' ))
6+ skipDefaultCheckout()
7+ }
8+
9+ stages {
10+ stage(' Тестирование кода пакета WIN' ) {
11+
12+ agent { label ' windows' }
13+
14+ steps {
15+ checkout scm
16+
17+ script {
18+ if ( fileExists (' tasks/test.os' ) ){
19+ bat ' chcp 65001 > nul && oscript tasks/test.os'
20+ junit ' tests.xml'
21+ junit ' bdd-log.xml'
22+ }
23+ else
24+ echo ' no testing task'
25+ }
26+
27+ }
28+
29+ }
30+
31+ stage(' Тестирование кода пакета LINUX' ) {
32+
33+ agent { label ' master' }
34+
35+ steps {
36+ echo ' under development'
37+ }
38+
39+ }
40+
41+ stage(' Сборка пакета' ) {
42+
43+ agent { label ' windows' }
44+
45+ steps {
46+ checkout scm
47+
48+ bat ' erase /Q *.ospx'
49+ bat ' chcp 65001 > nul && call opm build .'
50+
51+ stash includes : ' *.ospx' , name : ' package'
52+ archiveArtifacts ' *.ospx'
53+ }
54+
55+ }
56+
57+ stage(' Публикация в хабе' ) {
58+ when {
59+ branch ' master'
60+ }
61+ agent { label ' master' }
62+ steps {
63+ sh ' rm -f *.ospx'
64+ unstash ' package'
65+
66+ sh '''
67+ artifact=`ls -1 *.ospx`
68+ basename=`echo $artifact | sed -r 's/(.+)-.*(.ospx)/\\ 1/'`
69+ cp $artifact $basename.ospx
70+ sudo rsync -rv *.ospx /var/www/hub.oscript.io/download/$basename/
71+ ''' . stripIndent()
72+ }
73+ }
74+
75+ stage(' Публикация в нестабильном хабе' ) {
76+ when {
77+ branch ' develop'
78+ }
79+ agent { label ' master' }
80+ steps {
81+ sh ' rm -f *.ospx'
82+ unstash ' package'
83+
84+ sh '''
85+ artifact=`ls -1 *.ospx`
86+ basename=`echo $artifact | sed -r 's/(.+)-.*(.ospx)/\\ 1/'`
87+ cp $artifact $basename.ospx
88+ sudo rsync -rv *.ospx /var/www/hub.oscript.io/dev-channel/$basename/
89+ ''' . stripIndent()
90+ }
91+ }
92+ }
93+ }
You can’t perform that action at this time.
0 commit comments