Skip to content
Snippets Groups Projects
Commit 440ad905 authored by Andrew Coward's avatar Andrew Coward
Browse files

Tried to restore correct time order to test directories by prepending date to...

Tried to restore correct time order to test directories by prepending date to short hash. Date is a 5-digit number constructed from a 2-digit year and 3-digit year-day
parent 522ad4c1
No related branches found
No related tags found
No related merge requests found
......@@ -171,19 +171,24 @@ clean_config() {
# define validation dir
set_valid_dir () {
#REVISION_NB=`${SVN_CMD} info ${SETTE_DIR}/.. | grep "Last Changed Rev" | awk '{print $NF}'`
REVISION_NB=`git rev-list --abbrev-commit origin | tail -1l`
REVISION_NB=`git rev-list --abbrev-commit origin | head -1l`
REV_DATE0="`git log -1 | grep Date | sed -e 's/.*Date: *//' -e's/ +.*$//'`"
REV_DATE=`${DATE_CONV}"${REV_DATE0}" +"%y%j"`
REVISION_NB=${REV_DATE}_${REVISION_NB}
if [ ${#REVISION_NB} -eq 0 ]
then
echo "some problems with ${SVN_CMD} info command"
echo "some problems with ${SVN_CMD} info command" >> ${SETTE_DIR}/output.sette
echo "some problems with git rev-list command"
echo "some problems with git rev-list command" >> ${SETTE_DIR}/output.sette
REVISION_NB=`date +%Y%m%d`
echo "put in ${REVISION_NB} date"
echo "put in ${REVISION_NB} date" >> ${SETTE_DIR}/output.sette
else
echo "value of revision number of NEMOGCM: ${REVISION_NB}"
fi
#[ `${SVN_CMD} status -q ${SETTE_DIR}/../{cfgs,tests,src} | wc -l` -ge 1 ] && REVISION_NB=${REVISION_NB}+
localchanges=`git status --short -uno | wc -l`
if [ $localchanges > 0 ] ; then
REVISION_NB=${REVISION_NB}+
fi
# remove last _ST followed by zero or more alphanumeric characters
NEW_CONF1=$( echo $NEW_CONF | sed -e 's/_ST\([0-9a-zA-Z]*\)$//' )
export NEMO_VALID=${NEMO_VALIDATION_DIR}/${CMP_NAM}/${REVISION_NB}/${NEW_CONF1}/${TEST_NAME}
......
......@@ -7,7 +7,7 @@ NEMO_REV_REF=0000
#
# ------------------------------------------------------------------------------------------
# IMPORTANT:
# variables (COMPILER, BATCH_CMD, BATCH_STAT, BATCH_NAME, FORCING_DIR, SVN_CMD)
# variables (COMPILER, BATCH_CMD, BATCH_STAT, BATCH_NAME, FORCING_DIR)
# can be exported from your shell startup files.
# If it is the case, nothing to do
# otherwise, you need to update the default initialisation
......@@ -46,9 +46,11 @@ JOB_PREFIX_NOMPMD=${SETTE_JOB_PREFIX_NOMPMD:-batch}
# ------------------------------------------------------------------------------------------
#
# MISCELLANEOUS
# command for svn (some people use git svn)
# used in sette_rpt and in all_function to display revision and build correct repository name
SVN_CMD=${SETTE_SVN_CMD:-svn}
# command for converting date (from git log -1) into 2-digit year + yearday
date -j -f "%a %b %d %H:%M:%S %Y" "Tue Nov 30 17:10:53 2021" +"%y%j" >& /dev/null
if [ $? == 0 ] ; then DATE_CONV='date -j -f "%a %b %d %H:%M:%S %Y" ' ;fi
date --date="Tue Nov 30 17:10:53 2021" +"%y%j" >& /dev/null
if [ $? == 0 ] ; then DATE_CONV='date --date=' ;fi
# only for IBM
#TMPDIR=${CONFIG_DIR}/${NEW_CONF}/EXP00
# cleaning CFG_ST
......
......@@ -150,7 +150,7 @@ function runcmpres(){
## ##
#########################################################################################
#
# LOAD param variable (COMPILER, NEMO_VALIDATION_DIR, SVN_CMD)
# LOAD param variable (COMPILER, NEMO_VALIDATION_DIR )
SETTE_DIR=$(cd $(dirname "$0"); pwd)
MAIN_DIR=$(dirname $SETTE_DIR)
quiet=0
......@@ -235,12 +235,15 @@ function runcmpres(){
#
if [ ${quiet} -eq 0 ] ; then echo "" ; fi
localchanges=`git status --short -uno | wc -l`
revision=`git rev-list --abbrev-commit origin | tail -1l`
branchname=`${SVN_CMD} info ${MAIN_DIR} | grep ^URL | awk -F ipsl/forge/projets/nemo/svn/ '{print $NF}'`
revision=`git rev-list --abbrev-commit origin | head -1l`
rev_date0=`git log -1 | grep Date | sed -e 's/.*Date: *//' -e's/ +.*$//'`
rev_date=`${DATE_CONV}"${rev_date0}" +"%y%j"`
revision=${rev_date}_${revision}
branchname=`git branch --show-current`
if [ ${quiet} -eq 0 ] ; then
if [ $localchanges > 0 ] ; then
echo "Current code is : $branchname @ $revision ( with local changes )"
lastchange=${revision}_++
lastchange=${revision}+
else
echo "Current code is : $branchname @ $revision"
lastchange=$revision
......
......@@ -463,7 +463,7 @@ function identictest(){
## ##
#########################################################################################
#
# LOAD param variable (COMPILER, NEMO_VALIDATION_DIR, SVN_CMD)
# LOAD param variable (COMPILER, NEMO_VALIDATION_DIR )
SETTE_DIR=$(cd $(dirname "$0"); pwd)
MAIN_DIR=$(dirname $SETTE_DIR)
. ./param.cfg
......@@ -542,11 +542,14 @@ function identictest(){
#
echo ""
localchanges=`git status --short -uno | wc -l`
revision=`git rev-list --abbrev-commit origin | tail -1l`
branchname=`${SVN_CMD} info ${MAIN_DIR} | grep ^URL | awk -F ipsl/forge/projets/nemo/svn/ '{print $NF}'`
revision=`git rev-list --abbrev-commit origin | head -1l`
rev_date0=`git log -1 | grep Date | sed -e 's/.*Date: *//' -e's/ +.*$//'`
rev_date=`${DATE_CONV}"${rev_date0}" +"%y%j"`
revision=${rev_date}_${revision}
branchname=`git branch --show-current`
if [ $localchanges > 0 ] ; then
echo "Current code is : $branchname @ $revision ( with local changes )"
lastchange=${revision}_++
lastchange=${revision}+
else
echo "Current code is : $branchname @ $revision"
lastchange=$revision
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment