mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 11:36:31 +00:00
gdrive update1
This commit is contained in:
@@ -77,8 +77,9 @@ pipeline {
|
||||
|
||||
stage('Cleanup Older Files on Google Drive') {
|
||||
steps {
|
||||
echo "Cleaning up older files on Google Drive..."
|
||||
powershell '''
|
||||
script {
|
||||
// Writing PowerShell cleanup script to a temporary file
|
||||
def cleanupScript = '''
|
||||
# List all files in the Google Drive folder
|
||||
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
|
||||
@@ -119,6 +120,17 @@ pipeline {
|
||||
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