Skip to content

Commit e7caca3

Browse files
committed
Merge branch 'master' into develop
2 parents 6f950c9 + 169965f commit e7caca3

11 files changed

+725
-4
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
oscript_modules/
2+
3+
tests\.xml

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"editor.rulers": [120]
4+
}

.vscode/tasks.json

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
{
2+
"version": "0.1.0",
3+
"windows": {
4+
"command": "cmd",
5+
// "args": ["/c"]
6+
"args": ["/c", "chcp 65001 >nul &"]
7+
},
8+
"linux": {
9+
"command": "sh",
10+
"args": ["-c"]
11+
},
12+
"isShellCommand": true,
13+
"showOutput": "silent",
14+
"tasks": [
15+
{
16+
"taskName": "Testing project",
17+
"args": [
18+
"1testrunner",
19+
"-runall",
20+
"${workspaceRoot}/tests"
21+
],
22+
"echoCommand": true,
23+
"showOutput": "always",
24+
"suppressTaskName": true,
25+
// "isBuildCommand": false,
26+
"isTestCommand": false,
27+
"problemMatcher": {
28+
"fileLocation": "absolute",
29+
"pattern": {
30+
"regexp": "{Модуль\\s+(.+)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+([^{]*)",
31+
"file": 1,
32+
"location": 2,
33+
"message": 3
34+
}
35+
}
36+
},
37+
{
38+
"taskName": "Testing current test-file",
39+
"args": [
40+
"1testrunner",
41+
"-run",
42+
"${file}"
43+
],
44+
"echoCommand": true,
45+
"showOutput": "always",
46+
"suppressTaskName": true,
47+
"isBuildCommand": false,
48+
"isTestCommand": true,
49+
"problemMatcher": {
50+
"fileLocation": "absolute",
51+
"pattern": {
52+
"regexp": "{Модуль\\s+(.+)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+([^{]*)",
53+
"file": 1,
54+
"location": 2,
55+
"message": 3
56+
}
57+
}
58+
},
59+
{
60+
"taskName": "Exec all features",
61+
"args": [
62+
"1bdd",
63+
"${workspaceRoot}/features",
64+
"-out",
65+
"${workspaceRoot}/exec.log"
66+
],
67+
"echoCommand": true,
68+
"showOutput": "always",
69+
"suppressTaskName": true,
70+
"isBuildCommand": true,
71+
"isTestCommand": false,
72+
"problemMatcher": {
73+
"fileLocation": "absolute",
74+
"pattern": {
75+
"regexp": "{Модуль\\s+(.+)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+([^{]*)",
76+
"file": 1,
77+
"location": 2,
78+
"message": 3
79+
}
80+
}
81+
},
82+
{
83+
"taskName": "Exec feature",
84+
"args": [
85+
"1bdd",
86+
"${file}",
87+
"-fail-fast",
88+
"-out",
89+
"${workspaceRoot}/exec.log"
90+
],
91+
"echoCommand": true,
92+
"showOutput": "always",
93+
"suppressTaskName": true,
94+
"isBuildCommand": false,
95+
"isTestCommand": true,
96+
"problemMatcher": {
97+
"fileLocation": "absolute",
98+
"pattern": [
99+
{
100+
"regexp": "{Модуль\\s+(.+)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+([^{]*)",
101+
"file": 1,
102+
"location": 2,
103+
"message": 3
104+
}
105+
]
106+
}
107+
},
108+
{
109+
"taskName": "Exec feature for current step def",
110+
"args": [
111+
"1bdd",
112+
"${fileDirname}/../${fileBasenameNoExtension}.feature",
113+
"-fail-fast",
114+
"-out",
115+
"${workspaceRoot}/exec.log"
116+
],
117+
"echoCommand": true,
118+
"showOutput": "always",
119+
"suppressTaskName": true,
120+
"isBuildCommand": false,
121+
"isTestCommand": true,
122+
"problemMatcher": {
123+
"fileLocation": "absolute",
124+
"pattern": [
125+
{
126+
"regexp": "{Модуль\\s+(.+)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+([^{]*)",
127+
"file": 1,
128+
"location": 2,
129+
"message": 3
130+
}
131+
]
132+
}
133+
},
134+
{
135+
"taskName": "Exec feature + debug",
136+
"args": [
137+
"1bdd",
138+
"${file}",
139+
"-fail-fast",
140+
"-verbose",
141+
"on",
142+
"-out",
143+
"${workspaceRoot}/exec.log"
144+
],
145+
"echoCommand": true,
146+
"showOutput": "always",
147+
"suppressTaskName": true,
148+
// "isBuildCommand": false,
149+
"isTestCommand": false,
150+
"problemMatcher": {
151+
"fileLocation": "absolute",
152+
"pattern": {
153+
"regexp": "{Модуль\\s+(.+)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+([^{]*)",
154+
"file": 1,
155+
"location": 2,
156+
"message": 3
157+
}
158+
}
159+
},
160+
{
161+
"taskName": "Generate feature steps",
162+
"args": [
163+
"1bdd",
164+
"gen",
165+
"${file}",
166+
"-out",
167+
"${workspaceRoot}/exec.log"
168+
],
169+
"echoCommand": true,
170+
"showOutput": "always",
171+
"suppressTaskName": true,
172+
"isBuildCommand": false,
173+
"isTestCommand": false,
174+
"problemMatcher": {
175+
"fileLocation": "absolute",
176+
"pattern": {
177+
"regexp": "{Модуль\\s+(.+)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+([^{]*)",
178+
"file": 1,
179+
"location": 2,
180+
"message": 3
181+
}
182+
}
183+
},
184+
{
185+
"taskName": "OneScript: compile",
186+
"args": [
187+
"oscript",
188+
"-encoding=utf-8",
189+
"-compile",
190+
"${file}"
191+
],
192+
"echoCommand": true,
193+
"showOutput": "always",
194+
"suppressTaskName": true,
195+
"isBuildCommand": false
196+
},
197+
{
198+
"taskName": "OneScript: check",
199+
"args": [
200+
"oscript",
201+
"-encoding=utf-8",
202+
"-check",
203+
"${file}"
204+
],
205+
"echoCommand": true,
206+
"showOutput": "always",
207+
"suppressTaskName": true,
208+
"isBuildCommand": false
209+
},
210+
{
211+
"taskName": "OneScript: make",
212+
"args": [
213+
"oscript",
214+
"-encoding=utf-8",
215+
"-make",
216+
"${file}",
217+
"${fileBasename}.exe"
218+
],
219+
"echoCommand": true,
220+
"showOutput": "always",
221+
"suppressTaskName": true,
222+
"isBuildCommand": false
223+
},
224+
{
225+
"taskName": "OneScript: run",
226+
"args": [
227+
"oscript",
228+
"-encoding=utf-8",
229+
"${file}"
230+
],
231+
"echoCommand": true,
232+
"showOutput": "always",
233+
"suppressTaskName": true,
234+
"isBuildCommand": true,
235+
"problemMatcher": {
236+
"fileLocation": "absolute",
237+
"pattern": {
238+
"regexp": "^{Модуль\\s+(.*)\\s\\/\\s.*:\\s+(\\d+)\\s+\\/\\s+(.*)}$",
239+
"file": 1,
240+
"location": 2,
241+
"message": 3
242+
}
243+
}
244+
}
245+
]
246+
}

Jenkinsfile

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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+
}

packagedef

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
.Версия("0.3.1")
44
.ВключитьФайл("src")
55
.ВключитьФайл("tests")
6-
.ВключитьФайл("lib.config")
6+
.ВключитьФайл("lib.config")
7+
.ВключитьФайл("readme.md")

0 commit comments

Comments
 (0)