forked from usegalaxy-eu/workflow-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-training.sh
executable file
·38 lines (32 loc) · 1.22 KB
/
update-training.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
clone(){
# fetch all training workflows
git clone --depth=1 https://github.com/galaxyproject/training-material.git
}
update_workflows() {
rm -rf training;
# For each -job.yml file, extract that workflows directory
for dir in $(find training-material/ -name '*-job.yml' | grep workflows | xargs dirname | sort -u); do
topic=$(echo "$dir" | awk -F/ '{print $3}')
tutorial=$(echo "$dir" | awk -F/ '{print $5}')
# into a nicer training/topic/tutorial/ dir
echo $dir $topic $tutorial
mkdir -p training/${topic}/;
cp -R $dir training/${topic}/${tutorial}/;
done
}
notify() {
echo "Please register or add the following:"
echo
find training -name '*-test.yml' | sed 's/-test.yml/.ga/'
echo
echo "And add the following to the readme:"
echo
for training in $(find training -name '*-test.yml' | sed 's/-test.yml/.ga/'); do
training_escape=$(echo $training | sed 's|/|%2F|g')
echo "$training | [![Build Status](https://build.galaxyproject.eu/job/usegalaxy-eu/job/workflow-testing/PYTHON=System-CPython-2.7,WORKFLOW=${training_escape}/badge/icon)](https://build.galaxyproject.eu/job/usegalaxy-eu/job/workflow-testing/PYTHON=System-CPython-2.7,WORKFLOW=${training_escape}/)"
done
}
#clone
update_workflows
notify