Statistiques
| Révision :

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

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

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.2 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
mkdir -p $TXMGIT
21

    
22
if [ ! -d "$TXMGIT" ]; then
23
	echo "** Error the GIT directory does not exists: $TXMGIT"
24
	exit 1;
25
fi
26

    
27
if [ ! -d "$CURRENTPATH/exportRCP/repository" ]; then
28
	echo "** Error: no TXM repository build found: $CURRENTPATH/exportRCP/repository"
29
	exit 1;
30
fi
31

    
32
echo "Preparing update files..."
33

    
34
MACOSXBUILD=`ls TXM_*_MacOSX/Applications/TXM-*.app/Contents/MacOS/TXM|tail -1`
35
if [ "$MACOSXBUILD" = "" ]; then
36
	echo "Error: no MAc OS X build. Call BuildMacOSX before"
37
	return
38
fi
39

    
40
echo "Fixing Mac OS X binary archive..."
41
cp -r `ls -d TXM_*_MacOSX/Applications/TXM-*.app/Contents/MacOS|tail -1` . && 
42
cp -f `ls TXM_*_MacOSX/Applications/TXM-*.app/Contents/Info.plist|tail -1` Info.plist && 
43
zip `ls exportRCP/repository/binary/org.txm.rcp.app_root.cocoa.macosx.x86_64_*|tail -1` -d Info.plist &&
44
#zip `ls exportRCP/repository/binary/org.txm.rcp.app_root.cocoa.macosx.x86_64_*|tail -1` -ur Info.plist &&
45
zip `ls exportRCP/repository/binary/org.txm.rcp.app_root.cocoa.macosx.x86_64_*|tail -1` -d MacOS &&
46
#zip `ls exportRCP/repository/binary/org.txm.rcp.app_root.cocoa.macosx.x86_64_*|tail -1` -ur MacOS &&
47
rm -r MacOS &&
48
rm Info.plist
49

    
50
if [ $? != 0 ]; then
51
	echo "** $APP: failed to prepare MacOS files"
52
	rm -r MacOS
53
	rm Info.plist
54
	exit 1;
55
fi
56

    
57
echo "Preparing GIT push..."
58
pushd $TXMGIT
59

    
60
if [ -z "$(git status --porcelain $TXMGIT)" ]; then 
61
	echo "GIT OK"
62
else 
63
	echo "Aborting GIT push: $TXMGIT repository is not clean."
64
	popd
65
	exit 1
66
fi
67

    
68
echo "rm previous version in `pwd`..."
69
git pull
70
git rm -r binary/*
71
git rm -r features/*
72
git rm -r plugins/*
73

    
74
pwd
75
echo "cp new build..."
76
cp -rf $CURRENTPATH/exportRCP/repository/* .
77

    
78
echo "git add commit push..."
79
git add --all .
80
git commit -m "push $LEVEL update of TXM-$VERSION"
81
git push
82

    
83
popd
84

    
85
echo "Done."