diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c269d5124c3a83a4115ad4c199fa1b96a3f9d5cc..8191ed18484ef7ff18ecc9a133d8f7926b6ca12c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,7 +25,8 @@ spell check: allow_failure: true script: #- npm i markdown-spellcheck -g - - mdspell '**/*.md' '!docs.it4i/module*.md' '!docs.it4i/anselm-cluster-documentation/software/omics-master/overview.md' '!docs.it4i/downtimes_history.md' -rns --en-us + - mdspell '**/*.md' '!docs.it4i/module*.md' '!docs.it4i/anselm-/add +cluster-documentation/software/omics-master/overview.md' '!docs.it4i/downtimes_history.md' -rns --en-us ext_links: stage: test @@ -46,10 +47,10 @@ mkdocs: script: #- apt-get update #- apt-get -y install git - - bash add_version.sh - - bash get_modules.sh + - bash scripts/add_version.sh + - bash scripts/get_modules.sh - mkdocs build - - bash clean_json.sh site/mkdocs/search_index.json + - bash scripts/clean_json.sh site/mkdocs/search_index.json - sed -i 's,href="" title=",href="/" title=",g' site/404.html artifacts: paths: diff --git a/add_version.sh b/scripts/add_version.sh similarity index 100% rename from add_version.sh rename to scripts/add_version.sh diff --git a/clean_json.sh b/scripts/clean_json.sh similarity index 100% rename from clean_json.sh rename to scripts/clean_json.sh diff --git a/cluster_modules.py b/scripts/cluster_modules.py similarity index 100% rename from cluster_modules.py rename to scripts/cluster_modules.py diff --git a/colors.sh b/scripts/colors.sh similarity index 100% rename from colors.sh rename to scripts/colors.sh diff --git a/get_cvs.sh b/scripts/get_cvs.sh similarity index 100% rename from get_cvs.sh rename to scripts/get_cvs.sh diff --git a/get_modules.sh b/scripts/get_modules.sh similarity index 100% rename from get_modules.sh rename to scripts/get_modules.sh diff --git a/scripts/modules.py b/scripts/modules.py deleted file mode 100755 index a58c9747c3976e4ec40417495226c075800f5277..0000000000000000000000000000000000000000 --- a/scripts/modules.py +++ /dev/null @@ -1,95 +0,0 @@ -##!/usr/bin/env python -# -# Copyright (C) 2016 IT4Innovations -# -## - -import json -import os -import re -import xmlrpclib - - -def software_list(class_path): - """List software from given module class""" - os.chdir(class_path) - software_list = next(os.walk('.'))[1] - # In case that there is 'all' module - if 'all' in software_list: - software_list.remove('all') - return software_list - - -def get_software_versions(software_path): - """List available versions of software""" - os.chdir(software_path) - return next(os.walk('.'))[2] - - -def get_module_description(module_path): - """Return software homepage URL and description""" - url = "" - description = " " - with open(module_path) as f: - content = f.read() - data = re.search(r"module-whatis\s{(Description: )?(.+)\s-\sHomepage:\s(\S+)}", - content, re.DOTALL) - try: - description = data.group(2) - url = data.group(3) - except AttributeError: - pass - return url, description - -def push_to_portal(page): - """Push HTML page to the user portal""" - remote = 'https://admin_write_modules_table:IcifomHantyi@docs.it4i.cz/' - server = xmlrpclib.ServerProxy(remote) - xmlout = server.xmlrpc_salomon_list_of_modules(page) - - -if __name__ == "__main__": - BASE_MODULES_DIR = '/apps/modules/' - SKIP_DIRS = ['all'] - HTML_SOURCE_DATA = {} - os.chdir(BASE_MODULES_DIR) - subdirs = next(os.walk('.'))[1] - # Delete unwanted directories - for dir in SKIP_DIRS: - subdirs.remove(dir) - - #print sorted(subdirs) - #subdirs = ['base'] - # Create module class structure - print "# List of Available Modules" - for dir in sorted(subdirs): - class_path = os.path.join(BASE_MODULES_DIR, dir) - available_software = software_list(class_path) - #print available_software - print "\n###%s\n" % dir.title() - print "|Module|Description|Available versions|" - print "|--|--|--|" - HTML_SOURCE_DATA[dir] = {} - for soft in sorted(available_software, key=str.lower): - software_path = os.path.join(class_path, soft) - software_versions = get_software_versions(software_path) - # In case that there's not any available software version - if not software_versions: - continue - first_module_path = os.path.join(software_path, software_versions[0]) - software_url, software_description = get_module_description(first_module_path) - #print software_description - HTML_SOURCE_DATA[dir][soft] = {'versions': [], - 'url': software_url, - 'description': software_description} - for version in software_versions: - HTML_SOURCE_DATA[dir][soft]['versions'].append(version) - #for version in software_versions: - # HTML_SOURCE_DATA[dir][soft]['versions'].append(version) - if software_url=="": - print "|**%s**|%s|<nobr>%s</nobr>|" % (soft," ".join(software_description.split()),'</br>'.join(software_versions)) - else: - print "|**[%s](%s)**|%s|<nobr>%s</nobr>|" % (soft,software_url," ".join(software_description.split()),'</br>'.join(software_versions)) - #json_obj = json.dumps(HTML_SOURCE_DATA, sort_keys=True, indent=4) - #push_to_portal(json_obj) - #print json_obj diff --git a/scripts/modules_compare.py b/scripts/modules_compare.py deleted file mode 100755 index e45c06570f3f593c7df1eddbc928606f59ef381d..0000000000000000000000000000000000000000 --- a/scripts/modules_compare.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (C) 2016 IT4Innovations -# - -import os - -def software_list(class_path): - """List software from given module class""" - os.chdir(class_path) - software_list = next(os.walk('.'))[1] - # In case that there is 'all' module - if 'all' in software_list: - software_list.remove('all') - return software_list - - -def get_software_versions(software_path): - """List available versions of software""" - os.chdir(software_path) - return next(os.walk('.'))[2] - -if __name__ == "__main__": - BASE_MODULES_DIR = '/apps/modules/' - SKIP_DIRS = ['all'] - HTML_SOURCE_DATA = {} - os.chdir(BASE_MODULES_DIR) - subdirs = next(os.walk('.'))[1] - # Delete unwanted directories - for dir in SKIP_DIRS: - subdirs.remove(dir) - - # Create module class structure - for dir in sorted(subdirs): - class_path = os.path.join(BASE_MODULES_DIR, dir) - available_software = software_list(class_path) - HTML_SOURCE_DATA[dir] = {} - for soft in sorted(available_software, key=str.lower): - software_path = os.path.join(class_path, soft) - software_versions = get_software_versions(software_path) - # In case that there's not any available software version - if not software_versions: - continue - first_module_path = os.path.join(software_path, software_versions[0]) - HTML_SOURCE_DATA[dir][soft] = {'versions': []} - for version in software_versions: - HTML_SOURCE_DATA[dir][soft]['versions'].append(version) - print "%s|%s" % (soft.lower(),';'.join(software_versions)) diff --git a/scripts/motd.sh b/scripts/motd.sh deleted file mode 100755 index 3d94de74b8f1278878b063ae094e869694c6fc0d..0000000000000000000000000000000000000000 --- a/scripts/motd.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -### MOTD and Downtime history -# autor: kru0052 -# 2016 IT4Innovations -# version 1.0 -### - -printf "update" -wget -q http://www.it4i.cz/support/?lang=en -printf " ... OK\n" - -i="index.html?lang=en" - -HEAD=$(grep -n -m1 'class="matrix light-grey' "$i" |cut -f1 -d: | tr --delete '\n') -END=$(grep -n -m1 '<h3>Other</h3>' "$i" |cut -f1 -d: | tr --delete '\n') -LAST=$(wc -l "$i" | cut -f1 -d' ') -DOWN=$((LAST-END+2)) - -sed '1,'"$((HEAD-1))"'d' "$i" | sed -n -e :a -e '1,'"$DOWN"'!{P;N;D;};N;ba' | sed '/<div/d' > "TMP.html" -rm "/srv/downtime/$i" - -title="Message of the day" -head=$(cat TMP.html | grep "rss-item-title" | cut -d ">" -f 2 | cut -d "<" -f 1) -date=$(cat TMP.html | grep "<i>" | cut -d ">" -f 2 | cut -d "<" -f 1 | cut -d " " -f 1) -info=$(cat TMP.html | grep "<p>" | cut -d ">" -f 2 | cut -d "<" -f 1) -rm /srv/downtime/TMP.html - -echo "" -echo "$title" -echo "$date - $head" -echo "$info" -echo "" - -# poovolene stavy - Salomon Maintenance, Anselm Maintenance, Back in Production, Infrastructure Maintenance, PBS Maintenance, SCRATCH Maintenance, HOME Maintenance, Salomon and Anselm Maintenance -if [ "$head" = "Salomon Maintenance" ] || [ "$head" = "Anselm Maintenance" ] || [ "$head" = "Back in Production" ] || [ "$head" = "Infrastructure Maintenance" ] || [ "$head" = "PBS Maintenance" ] || [ "$head" = "SCRATCH Maintenance" ] || [ "$head" = "HOME Maintenance" ] || [ "$head" = "Salomon and Anselm Maintenance" ]; then - dateDown=$(cat /srv/downtime/docs/index.md | sed -n '/---/{n;p;}' | cut -d "|" -f 2 | cut -d " " -f 1) - headDown=$(cat /srv/downtime/docs/index.md | sed -n '/---/{n;p;}' | cut -d "|" -f 3 | cut -d "*" -f 3) - - echo "$date - $dateDown" - - - if [ "$date" = "$dateDown" ] && [ "$head" = "$headDown" ]; then - echo "Everything up-to-date..." - else - echo "Updating Downtime History..." - test=" |$date 00:00:00|**$head** $info|" - sed '/---/a '"$test"'' /srv/downtime/docs/index.md > /srv/downtime/TMP.md - cat /srv/downtime/TMP.md > /srv/downtime/docs/index.md - # rm /srv/downtime/TMP.md - fi - -# echo "### $title" > docs/index.md -# echo "**$head**" >> docs/index.md -# echo "$date - $info" >> docs/index.md -else - echo "Downtime History not updated..." -fi - - echo "# $title" > docs/motd.md - echo "**$head**" >> docs/motd.md - echo "$date - $info" >> docs/motd.md - -time=$(date) - -sed '$d' /srv/downtime/docs/index.md > /srv/downtime/TMP.md -cat /srv/downtime/TMP.md > /srv/downtime/docs/index.md -rm /srv/downtime/TMP.md -echo "updating $time" >> /srv/downtime/docs/index.md diff --git a/scripts/html_md.sh b/scripts/preklopeni_dokumentace/html_md.sh similarity index 100% rename from scripts/html_md.sh rename to scripts/preklopeni_dokumentace/html_md.sh diff --git a/scripts/source/formatting b/scripts/preklopeni_dokumentace/source/formatting similarity index 100% rename from scripts/source/formatting rename to scripts/preklopeni_dokumentace/source/formatting diff --git a/scripts/source/lastFilter b/scripts/preklopeni_dokumentace/source/lastFilter similarity index 100% rename from scripts/source/lastFilter rename to scripts/preklopeni_dokumentace/source/lastFilter diff --git a/scripts/source/list_folder b/scripts/preklopeni_dokumentace/source/list_folder similarity index 100% rename from scripts/source/list_folder rename to scripts/preklopeni_dokumentace/source/list_folder diff --git a/scripts/source/list_image_mv b/scripts/preklopeni_dokumentace/source/list_image_mv similarity index 100% rename from scripts/source/list_image_mv rename to scripts/preklopeni_dokumentace/source/list_image_mv diff --git a/scripts/source/list_md_mv b/scripts/preklopeni_dokumentace/source/list_md_mv similarity index 100% rename from scripts/source/list_md_mv rename to scripts/preklopeni_dokumentace/source/list_md_mv diff --git a/scripts/source/list_rm b/scripts/preklopeni_dokumentace/source/list_rm similarity index 100% rename from scripts/source/list_rm rename to scripts/preklopeni_dokumentace/source/list_rm diff --git a/scripts/source/repairIMG b/scripts/preklopeni_dokumentace/source/repairIMG similarity index 100% rename from scripts/source/repairIMG rename to scripts/preklopeni_dokumentace/source/repairIMG diff --git a/scripts/source/replace b/scripts/preklopeni_dokumentace/source/replace similarity index 100% rename from scripts/source/replace rename to scripts/preklopeni_dokumentace/source/replace diff --git a/scripts/source/tab b/scripts/preklopeni_dokumentace/source/tab similarity index 100% rename from scripts/source/tab rename to scripts/preklopeni_dokumentace/source/tab diff --git a/scripts/source/tabREPLACE b/scripts/preklopeni_dokumentace/source/tabREPLACE similarity index 100% rename from scripts/source/tabREPLACE rename to scripts/preklopeni_dokumentace/source/tabREPLACE