mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 06:36:31 +00:00
pipelines zip and gdrive upload
updated
This commit is contained in:
+14
-13
@@ -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}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user