-
Notifications
You must be signed in to change notification settings - Fork 1
/
generate_stats_with_video.sh
executable file
·47 lines (35 loc) · 1.8 KB
/
generate_stats_with_video.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
39
40
41
42
43
44
45
46
47
#!/bin/bash
GITSTATS_SCRIPT_PATH="/Users/inza/Projects/Tools/gitstats/gitstats"
GOURCE_SCRIPT_PATH="/Users/inza/Projects/Tools/scripts/run_gource.sh"
STATS_OUTPUT_PATH="DartHackPrague_stats"
VIDEO_OUTPUT_PATH="DartHackPrague_visualization"
# Update Submodules
git submodule update
# Checkout master branches
find . -type d -mindepth 1 -maxdepth 1 -exec bash -c "cd '{}' && git pull origin master && git checkout master" \;
# Clean stats
find . -type d -mindepth 1 -maxdepth 1 -exec bash -c "cd '{}' && rm -Rf ./$STATS_OUTPUT_PATH" \;
# Generate stats
find . -type d -mindepth 1 -maxdepth 1 -exec bash -c "cd '{}' && $GITSTATS_SCRIPT_PATH . ./$STATS_OUTPUT_PATH" \;
# Add, Commit and Push generated stats
find . -type d -maxdepth 1 -exec bash -c "cd '{}' && git add -A && git commit -m 'Generated git repository statistics' && git pull origin master && git push origin master" \;
# Update Submodules
git submodule update
# Generate TOP Night Coder results
rm -f "top_night_coder.txt"
find . -type d -mindepth 1 -maxdepth 1 -exec bash -c "cd '{}/$STATS_OUTPUT_PATH' && cat activity.html | grep '%' | ../../parse_commits.rb >> ../../top_night_coder.txt" \;
echo
echo
cat "top_night_coder.txt"
./calculate.rb > "top_night_coder_results.txt"
cat "top_night_coder_results.txt"
# Clean stats
find . -type d -mindepth 1 -maxdepth 1 -exec bash -c "cd '{}' && rm -Rf ./$VIDEO_OUTPUT_PATH" \;
# Generate gource
find . -type d -mindepth 1 -maxdepth 1 -exec bash -c "cd '{}' && $GOURCE_SCRIPT_PATH $VIDEO_OUTPUT_PATH" \;
# Add, Commit and Push generated videos
find . -type d -maxdepth 1 -exec bash -c "cd '{}' && git add -A && git commit -m 'Generated git repository visualization' && git pull origin master && git push origin master" \;
# Copy all videos to one folder
mkdir -p videos
rm -fR videos/*
cp -f */$VIDEO_OUTPUT_PATH/*.mp4 "./videos/"