Commit 15845000 authored by MariaA's avatar MariaA
Browse files

Replacing jq for better test compatibility with native OS functions

parent 2b7b2109
......@@ -177,11 +177,11 @@ if [ $rc == 0 ] ; then
FileInfoUrl="https://gitlab.cern.ch/api/v4/projects/siteconf%2F${SiteName}/repository/files/JobConfig%2Fsite-local-config${subSiteName}.xml?ref=master"
FileInfoTmp=`mktemp /tmp/site-local-config-from-CVS-Markup.xml.XXX`
./fetch-from-web-gitlab \"$FileInfoUrl\" $FileInfoTmp
last_commit=`jq -r .last_commit_id $FileInfoTmp`
last_commit=$(grep -Po '"last_commit_id":.*?[^\\]",' ${FileInfoTmp} | perl -pe 's/"last_commit_id"://; s/^"//; s/",$//')
CommitInfoUrl="https://gitlab.cern.ch/api/v4/projects/siteconf%2F${SiteName}/repository/commits/${last_commit}"
./fetch-from-web-gitlab \"$CommitInfoUrl\" $FileInfoTmp
FileDate=`jq -r .authored_date $FileInfoTmp`
let seconds=`date +%s`-`date +%s -d "$FileDate"`
FileDate=$(grep -Po '"authored_date":.*?[^\\]",' ${FileInfoTmp} | perl -pe 's/"authored_date"://; s/^"//; s/",$//')
let seconds=`date +%s`-`date +%s -d $(echo ${FileDate} | awk -F "." '{print $1}')`
let cvsFileAgeInHours=$seconds/3600
echo "GITConfigFileAge: ${cvsFileAgeInHours} hours"
if [ $localConfigFileAgeInHours -gt 120 ] && [ $cvsFileAgeInHours -gt 120 ] ; then
......
Markdown is supported
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