Révision 3027
tmp/org.txm.setups/pushTXMUpdateToGIT.sh (revision 3027) | ||
---|---|---|
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." |
|
0 | 54 |
Formats disponibles : Unified diff