mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:46:30 +00:00
gdrive update1
This commit is contained in:
@@ -77,8 +77,9 @@ pipeline {
|
|||||||
|
|
||||||
stage('Cleanup Older Files on Google Drive') {
|
stage('Cleanup Older Files on Google Drive') {
|
||||||
steps {
|
steps {
|
||||||
echo "Cleaning up older files on Google Drive..."
|
script {
|
||||||
powershell '''
|
// Writing PowerShell cleanup script to a temporary file
|
||||||
|
def cleanupScript = '''
|
||||||
# List all files in the Google Drive folder
|
# List all files in the Google Drive folder
|
||||||
Write-Output "Listing all files in the folder ${params.GOOGLE_DRIVE_FOLDER} on Google Drive..."
|
Write-Output "Listing all files in the folder ${params.GOOGLE_DRIVE_FOLDER} on Google Drive..."
|
||||||
$files = rclone lsf --files-only AzaionGoogleDrive:${params.GOOGLE_DRIVE_FOLDER} --format "tp" --max-depth 1
|
$files = rclone lsf --files-only AzaionGoogleDrive:${params.GOOGLE_DRIVE_FOLDER} --format "tp" --max-depth 1
|
||||||
@@ -118,7 +119,18 @@ pipeline {
|
|||||||
} else {
|
} else {
|
||||||
Write-Output "No files found on Google Drive to clean up."
|
Write-Output "No files found on Google Drive to clean up."
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
// Write the PowerShell cleanup script to a temporary file
|
||||||
|
def tempScriptFile = "cleanup_script.ps1"
|
||||||
|
writeFile file: tempScriptFile, text: cleanupScript
|
||||||
|
|
||||||
|
// Run the PowerShell script
|
||||||
|
powershell script: tempScriptFile
|
||||||
|
|
||||||
|
// Clean up the temporary PowerShell script file
|
||||||
|
deleteFile tempScriptFile
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user