Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- originDBDir="/run/media/antoine/Maxtor/Tandoori-builds/doneDBs"
- appsFile="allApps.csv"
- outDir="output"
- inputDir="databases"
- githubKeyFile="./githubKey"
- echo "Synchronizing databases"
- for file in $(ls $originDBDir); do
- db=$(basename $file)
- if [[ ! -d $inputDir/$db ]];then
- echo "Copying database $db"
- cp -r -n $originDBDir/$db $inputDir
- fi
- done
- ##
- # Start the metrics calculation for the given app
- #
- # $1 - application name
- # $2 - application path on GitHub
- ##
- function startDevNote {
- appName=$1
- appPath=$2
- echo "##### Starting process for $appName ####"
- tmpOutput="/tmp/tandoori/$appName"
- mkdir -p $tmpOutput
- finalOutput="$outDir/$appName"
- echo "# Computing metrics for project $appName - $appPath"
- ./devNote.sh -d $inputDir/$appName -p $appPath -k "$(cat $githubKeyFile)" -o "$tmpOutput"
- echo "# Removing previous result and moving new"
- rm -rf $finalOutput
- mv $tmpOutput $finalOutput
- }
- if [[ -f $1 ]]; then
- # If we have a file as input argument (csv) we read it and do the given applications
- echo "Using input file $1"
- cat $1 | while IFS=, read name path; do
- if [[ -z $name && -z $path ]];then
- echo "Skipping empty line"
- else
- startDevNote $name $path
- fi
- done
- else
- # If no input is given we scan every available databases
- for db in $(ls $inputDir); do
- appName=$(basename $db)
- appPath=$(grep -- $appName $appsFile | cut -d, -f2)
- startDevNote $appName $appPath
- done
- fi
- #./packResults.sh
- tarName="results-$(date +"%Y-%m-%d_%H-%M-%S")"
- echo "Creating tarball $tarName"
- tar caf "$tarName" $outDir/*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement