root / tmp / org.txm.setups / pushTXMExtUpdateToGIT.sh @ 3147
Historique | Voir | Annoter | Télécharger (1,49 ko)
1 |
#!/bin/bash |
---|---|
2 |
|
3 |
if [ ! $# -eq 2 ] |
4 |
then |
5 |
echo "** Error: called with $# args. usage: 'pushTXMExtUpdateToGIT.sh VERSION LEVEL'" |
6 |
echo "** eg ./pushTXMExtUpdateToGIT.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/ext/$LEVEL" |
18 |
TXMGIT=$TXMGITROOT/$TXMGITLOCAL |
19 |
|
20 |
mkdir -p $TXMGIT |
21 |
|
22 |
echo "TXM GIT directory: $TXMGIT" |
23 |
|
24 |
if [ ! -d "$TXMGIT" ]; then |
25 |
echo "** Error the GIT directory does not exists: $TXMGIT" |
26 |
exit 1; |
27 |
fi |
28 |
|
29 |
DIRECTORYTOCOPY="TXMReleasePlugins.site" |
30 |
if [ "$LEVEL" = "dev" ]; then |
31 |
DIRECTORYTOCOPY="TXMDevPlugins.site" |
32 |
fi |
33 |
if [ "$LEVEL" = "alpha" ]; then |
34 |
DIRECTORYTOCOPY="TXMAlphaPlugins.site" |
35 |
fi |
36 |
if [ "$LEVEL" = "beta" ]; then |
37 |
DIRECTORYTOCOPY="TXMBetaPlugins.site" |
38 |
fi |
39 |
|
40 |
DIRECTORYTOCOPY="$CURRENTPATH/../$DIRECTORYTOCOPY" |
41 |
if [ ! -d "$DIRECTORYTOCOPY" ]; then |
42 |
echo "** Error: no TXM repository build found: $CURRENTPATH/exportRCP/repository" |
43 |
exit 1; |
44 |
fi |
45 |
|
46 |
echo "Directory to copy: $DIRECTORYTOCOPY" |
47 |
|
48 |
echo "Preparing GIT push..." |
49 |
pushd $TXMGIT |
50 |
|
51 |
if [ -z "$(git status --porcelain $TXMGIT)" ]; then |
52 |
echo "GIT OK" |
53 |
else |
54 |
echo "Aborting GIT push: $TXMGIT repository is not clean." |
55 |
popd |
56 |
exit 1 |
57 |
fi |
58 |
|
59 |
echo "rm previous version in `pwd`..." |
60 |
git rm -r binary/* |
61 |
git rm -r features/* |
62 |
git rm -r plugins/* |
63 |
|
64 |
pwd |
65 |
echo "cp new build..." |
66 |
cp -rf $DIRECTORYTOCOPY/* . |
67 |
|
68 |
echo "git add commit push..." |
69 |
git add --all . |
70 |
git commit -m "push $LEVEL update of TXM-$VERSION" |
71 |
git push |
72 |
|
73 |
popd |
74 |
|
75 |
echo "Done." |