Skip to content
Snippets Groups Projects
get_modules.sh 1.17 KiB
Newer Older
  • Learn to ignore specific revisions
  • Easy Build's avatar
    Easy Build committed
    # !/bin/bash
    
    
    Easy Build's avatar
    Easy Build committed
    PWD="/home/easybuild/git/it4i-modules"
    
    easybuild's avatar
    easybuild committed
    cd $PWD
    
    STATE=$(git fetch 2>&1 | grep master)
    if [ ! -z "$STATE" ]; then
       git pull
    
    easybuild's avatar
    easybuild committed
       ./get_modules.sh
    
    easybuild's avatar
    easybuild committed
       exit 0
    
    easybuild's avatar
    easybuild committed
    fi
    
    
    Easy Build's avatar
    Easy Build committed
    if [ ! -z `hostname -f | grep "bullx"` ]; then
    
    Easy Build's avatar
    Easy Build committed
       ml --show-hidden -t av 2>&1 > /dev/null| awk '{print $1 ",1"}' | grep -v -e '/,\|:' > anselm.csv
       ./modules.py > anselm.md
    
    Easy Build's avatar
    Easy Build committed
    else
    
    Easy Build's avatar
    Easy Build committed
       ml --show-hidden -t av 2>&1 > /dev/null| awk '{print $1 ",2"}' | grep -v -e '/,\|:' > salomon.csv
    
       ./modules.py > salomon.md
    
    Easy Build's avatar
    Easy Build committed
    
       MODULEBASE="/appsuv/modules"
       MODULEPATH=""
    
        for dir in `ls $MODULEBASE`
        do
            # Exclude following directories
            if [[ ($dir == "all") ]]; then
                continue
            fi
            # In case that it's directory
            if [ -d $MODULEBASE/$dir ]; then
                if [ -z $MODULEPATH ]; then
                    MODULEPATH="$MODULEBASE/$dir"
                else
                    MODULEPATH="$MODULEPATH:$MODULEBASE/$dir"
                fi
            fi
        done
    
       export MODULEPATH
    
    Easy Build's avatar
    Easy Build committed
       ml --show-hidden -t av 2>&1 > /dev/null| awk '{print $1 ",3"}' | grep -v -e '/,\|:' > uv2000.csv
       ./modules.py > uv2000.md
    
    Easy Build's avatar
    Easy Build committed
    fi
    
    
    DATE=`date -R`
    
    git diff --exit-code || git commit -am "$DATE"
    git push origin master