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) {
|
def storeFolderInCache(folderToStore, cacheDestiny) {
|
||||||
if (fileExists(folderToStore)) {
|
script {
|
||||||
println('Storing in cache')
|
env.folderToStore = folderToStore
|
||||||
sh "sudo mkdir -p ${cacheDestiny}"
|
env.cacheDestiny = cacheDestiny
|
||||||
sh "sudo mv ${folderToStore}/* ${cacheDestiny}"
|
sh(script: '''#!/bin/bash -xe
|
||||||
} else {
|
if [[ (-d ${folderToStore}) && ("$(ls -A ${folderToStore})") ]]; then
|
||||||
println('Folder to store in cache does not exist')
|
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