pipelines zip and gdrive upload

updated
This commit is contained in:
dzaitsev
2025-05-07 19:36:40 +03:00
parent 81620888f2
commit d1520109ef
+14 -13
View File
@@ -15,7 +15,6 @@ pipeline {
stage('Declarative: Tool Install') {
steps {
// Ensure required tools are available, like Git, PowerShell, etc.
echo "Installing tools if necessary"
}
}
@@ -23,7 +22,6 @@ pipeline {
stage('Initialize Workspace') {
steps {
echo "Initializing workspace on Windows agent..."
// Initialization steps for workspace
}
}
@@ -32,19 +30,22 @@ pipeline {
script {
echo "Finding latest zip file in: C:/Jenkins/workspace/Azaion/suite"
dir('C:/Jenkins/workspace/Azaion/suite') {
// Debug output to confirm current directory contents
echo "Listing .zip files in the directory:"
bat(script: 'dir /b *.zip', returnStdout: true).trim()
// List all .zip files starting with "AzaionSuite"
def zipFiles = bat(script: 'dir /b AzaionSuite*.zip', returnStdout: true).trim().split("\n")
// Get the most recent .zip file based on modification date
def latestZip = bat(script: 'dir /b /od *.zip | head -n 1', returnStdout: true).trim()
if (latestZip) {
env.LATEST_ZIP_FILENAME = latestZip
echo "✅ Latest zip file selected: ${env.LATEST_ZIP_FILENAME}"
} else {
error "No valid zip files found in the directory!"
if (zipFiles.isEmpty()) {
error "No zip files found matching the pattern 'AzaionSuite*.zip'!"
}
// Sort the files by date (timestamp) in the filename
def latestZip = zipFiles.sort { a, b ->
def dateA = a.split('-')[1]
def dateB = b.split('-')[1]
return dateB.compareTo(dateA)
}.first()
env.LATEST_ZIP_FILENAME = latestZip
echo "✅ Latest zip file selected: ${env.LATEST_ZIP_FILENAME}"
}
}
}