refs TG-3: build Windows Qt
This commit is contained in:
Vendored
+84
-2
@@ -1,13 +1,20 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent none
|
agent none
|
||||||
|
|
||||||
|
environment {
|
||||||
|
TAIGA_PROJECT_ID = '1'
|
||||||
|
TAIGA_URL = 'https://taiga.grigowashere.ru'
|
||||||
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Build Windows Qt') {
|
stage('Build Windows Qt') {
|
||||||
agent { label 'windows' }
|
agent { label 'windows' }
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
deleteDir()
|
deleteDir()
|
||||||
checkout scm
|
checkout scm
|
||||||
bat '''
|
|
||||||
|
bat '''
|
||||||
call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat"
|
call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat"
|
||||||
|
|
||||||
cmake -S . -B build\\windows -G Ninja ^
|
cmake -S . -B build\\windows -G Ninja ^
|
||||||
@@ -27,10 +34,85 @@ bat '''
|
|||||||
"%WINDEPLOYQT%" --release --no-translations dist\\windows\\test_app.exe
|
"%WINDEPLOYQT%" --release --no-translations dist\\windows\\test_app.exe
|
||||||
|
|
||||||
xcopy /Y /I C:\\vcpkg\\installed\\x64-windows\\bin\\*.dll dist\\windows\\
|
xcopy /Y /I C:\\vcpkg\\installed\\x64-windows\\bin\\*.dll dist\\windows\\
|
||||||
'''
|
'''
|
||||||
|
|
||||||
archiveArtifacts artifacts: 'dist/windows/**', fingerprint: true
|
archiveArtifacts artifacts: 'dist/windows/**', fingerprint: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
node('windows') {
|
||||||
|
script {
|
||||||
|
def result = currentBuild.currentResult ?: 'UNKNOWN'
|
||||||
|
|
||||||
|
withCredentials([string(credentialsId: 'TAIGA_TOKEN', variable: 'TAIGA_TOKEN')]) {
|
||||||
|
powershell(returnStatus: true, script: """
|
||||||
|
\$commitMsg = git log -1 --pretty=%B
|
||||||
|
\$match = [regex]::Match(\$commitMsg, 'TG-(\\d+)')
|
||||||
|
|
||||||
|
if (-not \$match.Success) {
|
||||||
|
Write-Host "No TG-* reference found"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
\$ref = \$match.Groups[1].Value
|
||||||
|
\$headers = @{
|
||||||
|
Authorization = "Bearer \$env:TAIGA_TOKEN"
|
||||||
|
"Content-Type" = "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
\$targets = @(
|
||||||
|
@{ endpoint = "userstories"; label = "User Story" },
|
||||||
|
@{ endpoint = "issues"; label = "Issue" },
|
||||||
|
@{ endpoint = "tasks"; label = "Task" }
|
||||||
|
)
|
||||||
|
|
||||||
|
\$found = \$null
|
||||||
|
|
||||||
|
foreach (\$target in \$targets) {
|
||||||
|
try {
|
||||||
|
\$url = "\$env:TAIGA_URL/api/v1/\$(\$target.endpoint)/by_ref?project=\$env:TAIGA_PROJECT_ID&ref=\$ref"
|
||||||
|
\$data = Invoke-RestMethod -Uri \$url -Headers \$headers -Method Get
|
||||||
|
if (\$data.id) {
|
||||||
|
\$found = @{
|
||||||
|
endpoint = \$target.endpoint
|
||||||
|
label = \$target.label
|
||||||
|
data = \$data
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Write-Host "Taiga lookup warning: \$($_.Exception.Message)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not \$found) {
|
||||||
|
Write-Host "Taiga TG-\$ref not found"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
\$comment = "Jenkins Windows Qt build #$env:BUILD_NUMBER: ${result}`n$env:BUILD_URL"
|
||||||
|
|
||||||
|
\$body = @{
|
||||||
|
comment = \$comment
|
||||||
|
version = \$found.data.version
|
||||||
|
} | ConvertTo-Json
|
||||||
|
|
||||||
|
try {
|
||||||
|
\$url = "\$env:TAIGA_URL/api/v1/\$(\$found.endpoint)/\$(\$found.data.id)"
|
||||||
|
Invoke-RestMethod -Uri \$url -Headers \$headers -Method Patch -Body \$body
|
||||||
|
Write-Host "Commented Taiga TG-\$ref (\$(\$found.label))"
|
||||||
|
} catch {
|
||||||
|
Write-Host "Taiga comment warning: \$($_.Exception.Message)"
|
||||||
|
}
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
""")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user