mirror of https://github.com/OpenVidu/openvidu.git
openvidu-test-e2e: improve storeFolderInCache
parent
7f24241bc4
commit
2b6752fd73
|
@ -146,12 +146,18 @@ def removeStrandedContainers(removeTestingContainers) {
|
|||
}
|
||||
|
||||
def storeFolderInCache(folderToStore, cacheDestiny) {
|
||||
if (fileExists(folderToStore)) {
|
||||
println('Storing in cache')
|
||||
sh "sudo mkdir -p ${cacheDestiny}"
|
||||
sh "sudo mv ${folderToStore}/* ${cacheDestiny}"
|
||||
} else {
|
||||
println('Folder to store in cache does not exist')
|
||||
script {
|
||||
env.folderToStore = folderToStore
|
||||
env.cacheDestiny = cacheDestiny
|
||||
sh(script: '''#!/bin/bash -xe
|
||||
if [[ (-d ${folderToStore}) && ("$(ls -A ${folderToStore})") ]]; then
|
||||
echo "Storing in cache"
|
||||
sudo mkdir -p ${cacheDestiny}
|
||||
sudo mv ${folderToStore}/* ${cacheDestiny}
|
||||
else
|
||||
echo "Folder to store in cache does not exist or is empty"
|
||||
fi
|
||||
'''.stripIndent())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue