Skip to content
Snippets Groups Projects
get_modules.sh 900 B
Newer Older
David Hrbáč's avatar
David Hrbáč committed
#!/bin/bash
David Hrbáč's avatar
David Hrbáč committed
# vim: ai ts=2 sw=2 et sts=2 ft=sh
Easy Build's avatar
Easy Build committed

Easy Build's avatar
Easy Build committed
PWD="/home/easybuild/git/it4i-modules"
cd $PWD || exit 1
easybuild's avatar
easybuild committed

STATE=$(git fetch 2>&1 | grep master)
if [ ! -z "$STATE" ]; then
David Hrbáč's avatar
David Hrbáč committed
  git pull
  ./get_modules.sh
  exit 0
easybuild's avatar
easybuild committed
fi

CLUSTER="$CLUSTERNAME"
if [ -z "$CLUSTER" ]; then
   echo "CLUSTERNAME not defined"
   exit 1
fi

if [ "$CLUSTER" == "DGX" ]; then
   ml --show-hidden -t av 2>&1 | awk '{print $1 ",4}' | grep -v -e '/,\|:' | sort -u > dgx.csv
  ./modules.py > dgx.md
elif [ "$CLUSTER" == "BARBORA" ]; then
   ml --show-hidden -t av 2>&1 | awk '{print $1 ",2"}' | grep -v -e '/,\|:' | sort -u > barbora.csv
     ./modules.py > barbora.md
elif [ "$CLUSTER" == "KAROLINA" ]; then
   ml --show-hidden -t av 2>&1 | awk '{print $1 ",1"}' | grep -v -e '/,\|:' | sort -u > karolina.csv
        ./modules.py > karolina.md
Easy Build's avatar
Easy Build committed
fi
David Hrbáč's avatar
David Hrbáč committed
DATE=$(date -R)
git diff --exit-code || git commit -am "$DATE"
git push origin master