updated pipelines zip and gdrive upload

This commit is contained in:
dzaitsev
2025-05-07 18:37:26 +03:00
parent 5c87f536c1
commit c3e4b741c8
2 changed files with 13 additions and 10 deletions
+4 -3
View File
@@ -7,6 +7,7 @@ pipeline {
parameters { parameters {
string(name: 'GOOGLE_DRIVE_FOLDER', defaultValue: 'AzaionSuiteBuilds', description: 'The folder on Google Drive where the build will be uploaded.') string(name: 'GOOGLE_DRIVE_FOLDER', defaultValue: 'AzaionSuiteBuilds', description: 'The folder on Google Drive where the build will be uploaded.')
string(name: 'buildPath', defaultValue: 'C:/Jenkins/workspace/AzaionSuite/suite', description: 'Path to folder containing zip builds.')
} }
environment { environment {
@@ -29,8 +30,8 @@ pipeline {
stage('Find Latest Zip') { stage('Find Latest Zip') {
steps { steps {
script { script {
echo "Finding latest zip file..." echo "Finding latest zip file in: ${params.buildPath}"
dir("C:/Jenkins/workspace/AzaionSuite/suite") { dir("${params.buildPath}") {
def output = powershell(returnStdout: true, script: ''' def output = powershell(returnStdout: true, script: '''
$pattern = "AzaionSuite*-*-*.zip" $pattern = "AzaionSuite*-*-*.zip"
$zipFiles = Get-ChildItem -Filter $pattern | Sort-Object Name -Descending $zipFiles = Get-ChildItem -Filter $pattern | Sort-Object Name -Descending
@@ -66,7 +67,7 @@ pipeline {
\$fileName = "${env.LATEST_ZIP_FILENAME}" \$fileName = "${env.LATEST_ZIP_FILENAME}"
\$folder = "${params.GOOGLE_DRIVE_FOLDER}" \$folder = "${params.GOOGLE_DRIVE_FOLDER}"
\$rcloneRemote = "AzaionGoogleDrive:\$folder" \$rcloneRemote = "AzaionGoogleDrive:\$folder"
\$localFilePath = "C:/Jenkins/workspace/AzaionSuite/suite/\$fileName" \$localFilePath = "${params.buildPath}/\$fileName"
Write-Output "Checking for existing files in: \$rcloneRemote" Write-Output "Checking for existing files in: \$rcloneRemote"
\$existingFiles = rclone lsf --files-only \$rcloneRemote \$existingFiles = rclone lsf --files-only \$rcloneRemote
+5 -3
View File
@@ -111,11 +111,13 @@ pipeline {
steps { steps {
script { script {
echo "Triggering Google Drive Upload pipeline: ${env.GOOGLE_DRIVE_UPLOAD_JOB_NAME}" echo "Triggering Google Drive Upload pipeline: ${env.GOOGLE_DRIVE_UPLOAD_JOB_NAME}"
build job: env.GOOGLE_DRIVE_UPLOAD_JOB_NAME build job: env.GOOGLE_DRIVE_UPLOAD_JOB_NAME, parameters: [
} string(name: 'buildPath', value: params.buildPath),
} string(name: 'GOOGLE_DRIVE_FOLDER', value: params.GOOGLE_DRIVE_FOLDER)
]
} }
} }
}
post { post {
success { success {