Statistiques
| Révision :

root / tmp / org.txm.setups / pushTXMExtUpdateToGIT.sh @ 3070

Historique | Voir | Annoter | Télécharger (1,68 ko)

1 3070 mdecorde
#!/bin/bash
2 3070 mdecorde
3 3070 mdecorde
if [ ! $# -eq 2 ]
4 3070 mdecorde
  then
5 3070 mdecorde
    echo "** Error: called with $# args. usage: 'pushTXMExtUpdateToGIT.sh VERSION LEVEL'"
6 3070 mdecorde
    echo "** eg ./pushTXMUpdateToGIT.sh 0.8.1 alpha"
7 3070 mdecorde
    exit 1
8 3070 mdecorde
fi
9 3070 mdecorde
10 3070 mdecorde
echo "SCRIPT NOT FINISHED"
11 3070 mdecorde
exit 1
12 3070 mdecorde
13 3070 mdecorde
CURRENTPATH="$(dirname $(realpath $0))"
14 3070 mdecorde
echo "PATH='$PATH'"
15 3070 mdecorde
VERSION=$1
16 3070 mdecorde
17 3070 mdecorde
LEVEL=$2
18 3070 mdecorde
LEVEL="${LEVEL,,}"
19 3070 mdecorde
TXMGITROOT=~/GIT/txm-software
20 3070 mdecorde
TXMGITLOCAL="dist/$VERSION/ext/$LEVEL"
21 3070 mdecorde
TXMGIT=$TXMGITROOT/$TXMGITLOCAL
22 3070 mdecorde
23 3070 mdecorde
if [ ! -d "$TXMGIT" ]; then
24 3070 mdecorde
	echo "** Error the GIT directory does not exists: $TXMGIT"
25 3070 mdecorde
	exit 1;
26 3070 mdecorde
fi
27 3070 mdecorde
28 3070 mdecorde
if [ ! -d "$CURRENTPATH/exportRCP/repository" ]; then
29 3070 mdecorde
	echo "** Error: no TXM repository build found: $CURRENTPATH/exportRCP/repository"
30 3070 mdecorde
	exit 1;
31 3070 mdecorde
fi
32 3070 mdecorde
33 3070 mdecorde
echo "Preparing update files..."
34 3070 mdecorde
35 3070 mdecorde
MACOSXBUILD=`ls TXM_*_MacOSX/Applications/TXM-*.app/Contents/MacOS/TXM|tail -1`
36 3070 mdecorde
if [ "$MACOSXBUILD" = "" ]; then
37 3070 mdecorde
	echo "Error: no MAc OS X build. Call BuildMacOSX before"
38 3070 mdecorde
	return
39 3070 mdecorde
fi
40 3070 mdecorde
41 3070 mdecorde
echo "Fixing Mac OS X binary archive..."
42 3070 mdecorde
cp -r `ls -d TXM_*_MacOSX/Applications/TXM-*.app/Contents/MacOS|tail -1` .
43 3070 mdecorde
zip `ls exportRCP/repository/binary/org.txm.rcp.app_root.cocoa.macosx.x86_64_*|tail -1` -d MacOS
44 3070 mdecorde
zip `ls exportRCP/repository/binary/org.txm.rcp.app_root.cocoa.macosx.x86_64_*|tail -1` -ur MacOS
45 3070 mdecorde
rm -r MacOS
46 3070 mdecorde
47 3070 mdecorde
echo "Preparing GIT push..."
48 3070 mdecorde
pushd $TXMGIT
49 3070 mdecorde
50 3070 mdecorde
if [ -z "$(git status --porcelain $TXMGIT)" ]; then
51 3070 mdecorde
	echo "GIT OK"
52 3070 mdecorde
else
53 3070 mdecorde
	echo "Aborting GIT push: $TXMGIT repository is not clean."
54 3070 mdecorde
	popd
55 3070 mdecorde
	exit 1
56 3070 mdecorde
fi
57 3070 mdecorde
58 3070 mdecorde
echo "rm previous version in `pwd`..."
59 3070 mdecorde
git rm -r binary/*
60 3070 mdecorde
git rm -r features/*
61 3070 mdecorde
git rm -r plugins/*
62 3070 mdecorde
63 3070 mdecorde
pwd
64 3070 mdecorde
echo "cp new build..."
65 3070 mdecorde
cp -rf $CURRENTPATH/exportRCP/repository/* .
66 3070 mdecorde
67 3070 mdecorde
echo "git add commit push..."
68 3070 mdecorde
git add --all .
69 3070 mdecorde
git commit -m "push $LEVEL update of TXM-$VERSION"
70 3070 mdecorde
git push
71 3070 mdecorde
72 3070 mdecorde
popd
73 3070 mdecorde
74 3070 mdecorde
echo "Done."