1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-10-08 22:51:57 +02:00

Main build (Jenkins)

This commit is contained in:
Vitaly the Alpaca (bot)
2025-07-01 19:40:39 +03:00
parent c93b5a36e4
commit dc9ef3b591
13 changed files with 8760 additions and 8374 deletions

143
ci/cli_test_en vendored
View File

@@ -11,41 +11,120 @@ pipeline {
label 'windows'
}
stages {
stage('Prepare'){
steps{
withCredentials([string(credentialsId: 'gpgkey', variable: 'GPGKEY')]) {
bat encoding: 'UTF-8', script:'gpg --quiet --batch --yes --decrypt --passphrase="%GPGKEY%" --output ./data.json ./data.json.gpg'
}
powershell encoding: 'UTF-8', script: '''
$batFile = "C:\\Program Files\\OneScript\\bin\\oint.bat"
if (Test-Path $batFile) {
Remove-Item -Path $batFile -Force
Write-Host "Файл oint.bat удален."
} else {
Write-Host "Файл oint.bat не найден, пропускаем удаление."
}
'''
stage('Decrypt Data') {
steps {
withCredentials([string(credentialsId: 'gpgkey', variable: 'GPGKEY')]) {
bat encoding: 'UTF-8', script:'gpg --quiet --batch --yes --decrypt --passphrase="%GPGKEY%" --output ./data.json ./data.json.gpg'
}
}
}
// Создание директории для загрузки, если её нет
bat 'if not exist "%USERPROFILE%\\Downloads" mkdir "%USERPROFILE%\\Downloads"'
stage('Remove oint.bat if exists') {
steps {
powershell encoding: 'UTF-8', script: '''
$batFile = "C:\\Program Files\\OneScript\\bin\\oint.bat"
if (Test-Path $batFile) {
Remove-Item -Path $batFile -Force
Write-Host "Файл oint.bat удален."
} else {
Write-Host "Файл oint.bat не найден, пропускаем удаление."
}
'''
// Скачивание инсталлера
powershell encoding: 'UTF-8', script: '''
$url = "https://jenkins.openintegrations.dev/job/OpiRelease/lastSuccessfulBuild/artifact/1.26.0/oint_1.26.0_installer_en.exe "
$output = "$env:USERPROFILE\\Downloads\\oint_installer.exe"
Invoke-WebRequest -Uri $url -OutFile $output
Write-Host "Инсталлер скачан в: $output"
'''
// Проверяем, что файл действительно удален
powershell encoding: 'UTF-8', script: '''
$batFile = "C:\\Program Files\\OneScript\\bin\\oint.bat"
if (Test-Path $batFile) {
Write-Error "Ошибка: Файл oint.bat не удален!"
exit 1
} else {
Write-Host "Проверка: oint.bat успешно удален или отсутствовал."
}
'''
}
}
// Запуск инсталляции (тихий режим для Inno Setup)
powershell encoding: 'UTF-8', script: '''
$installerPath = "$env:USERPROFILE\\Downloads\\oint_installer.exe"
Write-Host "Запускаем установку: $installerPath"
psexec -s -i "$installerPath" /VERYSILENT /NORESTART
Write-Host "Установка завершена."
'''
}
}
stage('Uninstall OInt if installed') {
steps {
powershell encoding: 'UTF-8', script: '''
$uninstallerPath = "C:\\Program Files (x86)\\OInt\\unins000.exe"
if (Test-Path $uninstallerPath) {
Write-Host "OInt найден. Запускаем удаление..."
Start-Process -FilePath $uninstallerPath -ArgumentList "/VERYSILENT /NORESTART" -Wait
Write-Host "Удаление OInt завершено."
} else {
Write-Host "OInt не установлен. Пропускаем этап удаления."
}
'''
// Проверяем, что oint.bat в C:\Program Files (x86)\OInt\bin\oint.bat удален
powershell encoding: 'UTF-8', script: '''
$batFile = "C:\\Program Files (x86)\\OInt\\bin\\oint.bat"
if (Test-Path $batFile) {
Write-Error "Ошибка: oint.bat всё ещё существует после uninstall!"
exit 1
} else {
Write-Host "Проверка: oint.bat после uninstall отсутствует."
}
'''
}
}
stage('Prepare Download Dir') {
steps {
bat 'if not exist "%USERPROFILE%\\Downloads" mkdir "%USERPROFILE%\\Downloads"'
}
}
stage('Download Installer') {
steps {
powershell encoding: 'UTF-8', script: '''
$url = "https://jenkins.openintegrations.dev/job/OpiRelease/lastSuccessfulBuild/artifact/1.26.0/oint_1.26.0_installer_en.exe "
$output = "$env:USERPROFILE\\Downloads\\oint_installer.exe"
Invoke-WebRequest -Uri $url -OutFile $output
Write-Host "Инсталлер скачан в: $output"
'''
}
}
stage('Install OInt') {
steps {
powershell encoding: 'UTF-8', script: '''
$installerPath = "$env:USERPROFILE\\Downloads\\oint_installer.exe"
Write-Host "Запускаем установку: $installerPath"
Start-Process -FilePath $installerPath -ArgumentList "/VERYSILENT /NORESTART" -NoNewWindow -Wait
Write-Host "Установка завершена."
'''
}
}
stage('Verify Installation') {
steps {
// Проверяем наличие oint.bat в C:\Program Files (x86)\OInt\bin\
powershell encoding: 'UTF-8', script: '''
$batFile = "C:\\Program Files (x86)\\OInt\\bin\\oint.bat"
if (-not (Test-Path $batFile)) {
Write-Error "Ошибка: oint.bat не найден после установки!"
exit 1
} else {
Write-Host "Проверка: oint.bat найден после установки."
}
'''
// Проверяем, что where oint выводит нужный путь
powershell encoding: 'UTF-8', script: '''
$result = (Get-Command oint -ErrorAction SilentlyContinue).Source
$expectedPath = "C:\\Program Files (x86)\\OInt\\bin\\oint.bat"
if ($result -ne $expectedPath) {
Write-Error "Ошибка: Команда 'where oint' указывает не на тот путь: $result"
exit 1
} else {
Write-Host "Проверка: 'where oint' указывает на правильный путь: $result"
}
'''
}
}
stage('Testing-Telegram') {
steps {