Magellan Linux

Annotation of /trunk/grubby/make-git-snapshot.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1348 - (hide annotations) (download) (as text)
Fri Jun 3 20:20:50 2011 UTC (12 years, 11 months ago) by niro
File MIME type: application/x-sh
File size: 728 byte(s)
gubby git snapshot script
1 niro 1348 #!/bin/sh
2    
3     # Usage: ./make-git-snapshot.sh [COMMIT]
4     #
5     # to make a snapshot of the given tag/branch. Defaults to HEAD.
6    
7     MODULE=grubby
8     DIRNAME=${MODULE}-7.0.16_$( date +%Y%m%d )
9     DESTINATION="root@cvs.magellan-linux.de:/var/www/htdocs/magellan/magellan-dev/sources/${MODULE}/"
10    
11     echo DIRNAME ${DIRNAME}
12     echo HEAD ${1:-HEAD}
13    
14     rm -rf ${DIRNAME}
15    
16     git clone git://git.fedorahosted.org/git/${MODULE}.git ${DIRNAME}
17    
18     GIT_DIR=${DIRNAME}/.git git archive --format=tar --prefix=${DIRNAME}/ ${1:-HEAD} \
19     | bzip2 > ${DIRNAME}.tar.bz2
20    
21     echo "Uploading latest tarball for ${DIRNAME}"
22     scp ${DIRNAME}.tar.bz2 ${DESTINATION}
23    
24     if [[ -d ${DIRNAME} ]]
25     then
26     rm -rf ${DIRNAME}
27     fi
28     if [[ -f ${DIRNAME}.tar.bz2 ]]
29     then
30     rm ${DIRNAME}.tar.bz2
31     fi
32    
33     exit 0