Skip to content

Commit 7cc7963

Browse files
committed
Merge branch 'hotfix/deb_opm'
2 parents d57c6a0 + ad01b6a commit 7cc7963

File tree

3 files changed

+62
-40
lines changed

3 files changed

+62
-40
lines changed

Build.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,16 @@
113113
<Target Name="GatherLibrary" DependsOnTargets="Make;GatherBinaries">
114114

115115
<MakeDir Directories="$(LibFolder)" />
116+
<CallTarget Targets="InstallStdLib" Condition="'$(StandardLibraryPacks)' != ''"/>
117+
<DeleteTree Directories="$(LibFolder)/opm" />
118+
116119
<Exec Command="&quot;$(ToolFolder)/oscript.exe&quot; &quot;$(MSBuildProjectDirectory)\install\unicode-zipper.os&quot; unpack &quot;$(MSBuildProjectDirectory)\install\opm-0.16.2.ospx&quot; &quot;$(LibFolder)\tmp&quot;"/>
117120
<Exec Command="&quot;$(ToolFolder)/oscript.exe&quot; &quot;$(MSBuildProjectDirectory)\install\unicode-zipper.os&quot; unpack &quot;$(LibFolder)\tmp\content.zip&quot; &quot;$(LibFolder)/opm&quot;"/>
121+
122+
<Copy SourceFiles="$(MSBuildProjectDirectory)\install\oscript-config.exe" DestinationFolder="$(TempFolder)/%(PlatformItem.BinFolder)" />
118123
<Copy SourceFiles="$(MSBuildProjectDirectory)\install\package-loader.os" DestinationFolder="$(LibFolder)"/>
119-
<DeleteTree Directories="$(LibFolder)\tmp"/>
120124

121-
<CallTarget Targets="InstallStdLib" Condition="'$(StandardLibraryPacks)' != ''"/>
125+
<DeleteTree Directories="$(LibFolder)\tmp"/>
122126

123127
</Target>
124128

@@ -166,7 +170,7 @@
166170
</Target>
167171

168172
<!-- Инсталлятор -->
169-
<Target Name="CreateInstaller" DependsOnTargets="PrepareDistributionContent">
173+
<Target Name="CreateInstaller" DependsOnTargets="PrepareArtifactsRoot">
170174
<Error Text="No installer path is specified" Condition="'$(InnoSetupPath)' == ''"/>
171175
<PropertyGroup>
172176
<InstallerStandardPath>"$(InnoSetupPath)\iscc.exe"</InstallerStandardPath>

Jenkinsfile

Lines changed: 55 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,62 @@ pipeline {
99
}
1010

1111
stages {
12-
stage('Windows Build') {
13-
agent { label 'windows' }
12+
stage('Build'){
13+
parallel {
14+
stage('Prepare Linux Environment') {
15+
agent{ label 'master'}
16+
steps{
17+
dir('install'){
18+
sh 'chmod +x make-dockers.sh && ./make-dockers.sh'
19+
}
20+
withCredentials([usernamePassword(credentialsId: 'docker-hub', passwordVariable: 'dockerpassword', usernameVariable: 'dockeruser')]) {
21+
sh """
22+
docker login -p $dockerpassword -u $dockeruser
23+
docker push oscript/onescript-builder:deb
24+
docker push oscript/onescript-builder:rpm
25+
""".stripIndent()
26+
}
27+
}
28+
}
1429

15-
// пути к инструментам доступны только когда
16-
// нода уже определена
17-
environment {
18-
NugetPath = "${tool 'nuget'}"
19-
StandardLibraryPacks = "${tool 'os_stdlib'}"
20-
}
30+
stage('Windows Build') {
31+
agent { label 'windows' }
2132

22-
steps {
23-
24-
// в среде Multibranch Pipeline Jenkins первращает имена веток в папки
25-
// а для веток Gitflow вида release/* экранирует в слэш в %2F
26-
// При этом MSBuild, видя urlEncoding, разэкранирует его обратно, ломая путь (появляется слэш, где не надо)
27-
//
28-
// Поэтому, применяем костыль с кастомным workspace
29-
// см. https://issues.jenkins-ci.org/browse/JENKINS-34564
30-
//
31-
// А еще Jenkins под Windows постоянно добавляет в конец папки какую-то мусорную строку.
32-
// Для этого отсекаем все, что находится после последнего дефиса
33-
// см. https://issues.jenkins-ci.org/browse/JENKINS-40072
34-
35-
ws(env.WORKSPACE.replaceAll("%", "_").replaceAll(/(-[^-]+$)/, ""))
36-
{
37-
step([$class: 'WsCleanup'])
38-
checkout scm
33+
// пути к инструментам доступны только когда
34+
// нода уже определена
35+
environment {
36+
NugetPath = "${tool 'nuget'}"
37+
StandardLibraryPacks = "${tool 'os_stdlib'}"
38+
}
3939

40-
bat "chcp $outputEnc > nul\r\n\"${tool 'MSBuild'}\" src/1Script.sln /t:restore && mkdir doctool"
41-
bat "chcp $outputEnc > nul\r\n dotnet publish src/OneScriptDocumenter/OneScriptDocumenter.csproj -c Release -o doctool"
42-
bat "chcp $outputEnc > nul\r\n\"${tool 'MSBuild'}\" Build.csproj /t:CleanAll;PrepareDistributionContent /p:OneScriptDocumenter=\"%WORKSPACE%/doctool/OneScriptDocumenter.exe\""
43-
44-
stash includes: 'tests, built/**', name: 'buildResults'
45-
}
46-
}
40+
steps {
41+
42+
// в среде Multibranch Pipeline Jenkins первращает имена веток в папки
43+
// а для веток Gitflow вида release/* экранирует в слэш в %2F
44+
// При этом MSBuild, видя urlEncoding, разэкранирует его обратно, ломая путь (появляется слэш, где не надо)
45+
//
46+
// Поэтому, применяем костыль с кастомным workspace
47+
// см. https://issues.jenkins-ci.org/browse/JENKINS-34564
48+
//
49+
// А еще Jenkins под Windows постоянно добавляет в конец папки какую-то мусорную строку.
50+
// Для этого отсекаем все, что находится после последнего дефиса
51+
// см. https://issues.jenkins-ci.org/browse/JENKINS-40072
52+
53+
ws(env.WORKSPACE.replaceAll("%", "_").replaceAll(/(-[^-]+$)/, ""))
54+
{
55+
step([$class: 'WsCleanup'])
56+
checkout scm
4757

58+
bat "chcp $outputEnc > nul\r\n\"${tool 'MSBuild'}\" src/1Script.sln /t:restore && mkdir doctool"
59+
bat "chcp $outputEnc > nul\r\n dotnet publish src/OneScriptDocumenter/OneScriptDocumenter.csproj -c Release -o doctool"
60+
bat "chcp $outputEnc > nul\r\n\"${tool 'MSBuild'}\" Build.csproj /t:CleanAll;PrepareDistributionContent /p:OneScriptDocumenter=\"%WORKSPACE%/doctool/OneScriptDocumenter.exe\""
61+
62+
stash includes: 'tests, built/**', name: 'buildResults'
63+
}
64+
}
65+
}
66+
}
4867
}
49-
5068
stage('VSCode debugger Build') {
5169
agent {
5270
docker {
@@ -154,8 +172,8 @@ pipeline {
154172

155173
stage('DEB distribution') {
156174
agent {
157-
dockerfile {
158-
dir 'install/builders/deb'
175+
docker {
176+
image 'oscript/onescript-builder:deb'
159177
label 'master'
160178
}
161179
}
@@ -170,8 +188,8 @@ pipeline {
170188

171189
stage('RPM distribution') {
172190
agent {
173-
dockerfile {
174-
dir 'install/builders/rpm'
191+
docker {
192+
image 'oscript/onescript-builder:rpm'
175193
label 'master'
176194
}
177195
}

install/oscript-config.exe

2.09 MB
Binary file not shown.

0 commit comments

Comments
 (0)