Statistiques
| Révision :

root / TXM / trunk / org.txm.setups / pushTXMUpdateToGIT.sh @ 3493

Historique | Voir | Annoter | Télécharger (2,09 ko)

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