root / tmp / org.txm.setups / pushTXMUpdateToGIT.sh @ 3030
Historique | Voir | Annoter | Télécharger (1,08 ko)
1 |
#!/bin/bash |
---|---|
2 |
|
3 |
if [ ! $# -eq 2 ] |
4 |
then |
5 |
echo "** Error: called with $# args. usage: 'pushTXMUpdateToGIT.sh VERSION LEVEL'" |
6 |
echo "** eg ./pushTXMUpdateToGIT.sh 0.8.1 alpha" |
7 |
exit 1 |
8 |
fi |
9 |
|
10 |
CURRENTPATH="$(dirname $(realpath $0))" |
11 |
echo "PATH='$PATH'" |
12 |
VERSION=$1 |
13 |
|
14 |
LEVEL=$2 |
15 |
LEVEL="${LEVEL,,}" |
16 |
TXMGITROOT=~/GIT/txm-software |
17 |
TXMGITLOCAL="dist/$VERSION/main/$LEVEL" |
18 |
TXMGIT=$TXMGITROOT/$TXMGITLOCAL |
19 |
|
20 |
if [ ! -d "$TXMGIT" ]; then |
21 |
echo "** Error the GIT directory does not exists: $TXMGIT" |
22 |
exit 1; |
23 |
fi |
24 |
|
25 |
if [ ! -d "$CURRENTPATH/exportRCP/repository" ]; then |
26 |
echo "** Error: no TXM repository build found: $CURRENTPATH/exportRCP/repository" |
27 |
exit 1; |
28 |
fi |
29 |
|
30 |
echo "Preparing GIT push..." |
31 |
pushd $TXMGIT |
32 |
|
33 |
if [ -z "$(git status --porcelain $TXMGIT)" ]; then |
34 |
echo "GIT OK" |
35 |
else |
36 |
echo "Aborting GIT push: $TXMGIT repository is not clean." |
37 |
popd |
38 |
exit 1 |
39 |
fi |
40 |
|
41 |
git rm -r $TXMGITLOCAL/binary/* |
42 |
git rm -r $TXMGITLOCAL/features/* |
43 |
git rm -r $TXMGITLOCAL/plugins/* |
44 |
|
45 |
cp -rf $CURRENTPATH/exportRCP/repository/* $TXMGITLOCAL |
46 |
|
47 |
git add --all $TXMGITLOCAL |
48 |
git commit -m "push $LEVEL update of TXM-$VERSION" |
49 |
git push |
50 |
|
51 |
popd |
52 |
|
53 |
echo "Done." |