Statistiques
| Révision :

root / tmp / org.txm.setups / pushTXMUpdateToGIT.sh @ 3224

Historique | Voir | Annoter | Télécharger (1,66 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 3027 mdecorde
    echo "** eg ./pushTXMUpdateToGIT.sh 0.8.1 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 3035 mdecorde
cp -r `ls -d TXM_*_MacOSX/Applications/TXM-*.app/Contents/MacOS|tail -1` .
42 3035 mdecorde
zip `ls exportRCP/repository/binary/org.txm.rcp.app_root.cocoa.macosx.x86_64_*|tail -1` -d MacOS
43 3035 mdecorde
zip `ls exportRCP/repository/binary/org.txm.rcp.app_root.cocoa.macosx.x86_64_*|tail -1` -ur MacOS
44 3035 mdecorde
rm -r MacOS
45 3035 mdecorde
46 3027 mdecorde
echo "Preparing GIT push..."
47 3027 mdecorde
pushd $TXMGIT
48 3027 mdecorde
49 3027 mdecorde
if [ -z "$(git status --porcelain $TXMGIT)" ]; then
50 3027 mdecorde
	echo "GIT OK"
51 3027 mdecorde
else
52 3027 mdecorde
	echo "Aborting GIT push: $TXMGIT repository is not clean."
53 3027 mdecorde
	popd
54 3027 mdecorde
	exit 1
55 3027 mdecorde
fi
56 3027 mdecorde
57 3054 mdecorde
echo "rm previous version in `pwd`..."
58 3054 mdecorde
git rm -r binary/*
59 3054 mdecorde
git rm -r features/*
60 3054 mdecorde
git rm -r plugins/*
61 3027 mdecorde
62 3035 mdecorde
pwd
63 3035 mdecorde
echo "cp new build..."
64 3035 mdecorde
cp -rf $CURRENTPATH/exportRCP/repository/* .
65 3027 mdecorde
66 3035 mdecorde
echo "git add commit push..."
67 3035 mdecorde
git add --all .
68 3027 mdecorde
git commit -m "push $LEVEL update of TXM-$VERSION"
69 3027 mdecorde
git push
70 3027 mdecorde
71 3027 mdecorde
popd
72 3027 mdecorde
73 3027 mdecorde
echo "Done."