pipelines zip and gdrive upload

updated
This commit is contained in:
dzaitsev
2025-05-07 20:11:05 +03:00
parent 6e1e6d903d
commit cea1c69fec
+6 -5
View File
@@ -12,6 +12,7 @@ pipeline {
environment { environment {
GOOGLE_DRIVE_FOLDER = 'AzaionSuiteBuilds' GOOGLE_DRIVE_FOLDER = 'AzaionSuiteBuilds'
RCLONE_CONFIG = 'C:/Program Files/rclone/rclone.conf' RCLONE_CONFIG = 'C:/Program Files/rclone/rclone.conf'
LATEST_ZIP_FILENAME = '' // Initial value
} }
stages { stages {
@@ -54,7 +55,7 @@ pipeline {
latestZip = 'none' // Handle case where no file is found latestZip = 'none' // Handle case where no file is found
} }
} }
// Use the latestZip directly for further stages // Directly assign the value to the env variable for use in other stages
env.LATEST_ZIP_FILENAME = latestZip env.LATEST_ZIP_FILENAME = latestZip
} }
} }
@@ -63,13 +64,13 @@ pipeline {
stage('Upload If Not Exists & Always Remove Local') { stage('Upload If Not Exists & Always Remove Local') {
when { when {
expression { expression {
return params.LATEST_ZIP_FILENAME != 'none' && params.LATEST_ZIP_FILENAME != '' return env.LATEST_ZIP_FILENAME != 'none'
} }
} }
steps { steps {
echo "Uploading ${params.LATEST_ZIP_FILENAME} if needed..." echo "Uploading ${env.LATEST_ZIP_FILENAME} if needed..."
powershell """ powershell """
\$fileName = "${params.LATEST_ZIP_FILENAME}" \$fileName = "${env.LATEST_ZIP_FILENAME}"
\$folder = "${GOOGLE_DRIVE_FOLDER}" \$folder = "${GOOGLE_DRIVE_FOLDER}"
\$rcloneRemote = "AzaionGoogleDrive:\$folder" \$rcloneRemote = "AzaionGoogleDrive:\$folder"
\$localPath = "${params.buildPath}/\$fileName" \$localPath = "${params.buildPath}/\$fileName"
@@ -96,7 +97,7 @@ pipeline {
stage('Cleanup Older Files on Google Drive') { stage('Cleanup Older Files on Google Drive') {
when { when {
expression { expression {
return params.LATEST_ZIP_FILENAME != 'none' && params.LATEST_ZIP_FILENAME != '' return env.LATEST_ZIP_FILENAME != 'none'
} }
} }
steps { steps {