Skip to content
Snippets Groups Projects
Commit c4be8ffc authored by Gervaise Henry's avatar Gervaise Henry :cowboy:
Browse files

Change error conditional in bdbag fetch to use file

parent 0f810d4d
Branches
Tags
2 merge requests!58Develop,!56Resolve "Detect error in inferMetadata for tracking"
Pipeline #8873 failed with stages
in 2 minutes and 10 seconds
#!/bin/bash #!/bin/bash
bdbag --materialize ${1} --debug bdbag --materialize ${1} --debug
validateError="true" validate=""
bdbag --validate full ${1} && validateError="false" bdbag --validate full ${1} 2> validate.txt
if [ "${validateError}" == "true" ] validate=$(tail -n validate.txt | grep -o 'is valid')
if [ "${validate}" != "is valid" ]
then then
n=0 n=0
until [ "${n}" -ge "3" ] until [ "${n}" -ge "3" ]
do do
bdbag --resolve-fetch missing --validate full ${1} --debug && validateError="false" && break bdbag --resolve-fetch missing --validate full ${1} --debug && validate=$(tail -n validate.txt | grep -o 'is valid') && break
n=$((n+1)) n=$((n+1))
sleep 15 sleep 15
done done
fi fi
if [ "${validateError}" == "true" ] if [ "${validate}" != "is valid" ]
then then
exit 1 exit 1
fi fi
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment