kolmapäev, 29. aprill 2015

Script for extracting sources for tags from multiple git repositories


archive-release.sh:

if [[ $1 ]]; then
declare -a folders=('project1' 'project2');
for f in "${folders[@]}"
do
   echo "Generate source from $f ..."
   cd $f ; git archive --format=tar.gz --prefix=$f/ $f-$1  >../$f-$1.tar.gz ; cd .. ;
done
echo "Finished!";
else
   echo "Version number parameter not provided (use like 1.0)";
fi

Git repository folders are project1, project2 etc.
Every repository has tags for releases like project1-1.0 - tag prefix and repository folder name should be same.

Minu blogide loend