Statistiques
| Révision :

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

Historique | Voir | Annoter | Télécharger (1,66 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.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/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
zip `ls exportRCP/repository/binary/org.txm.rcp.app_root.cocoa.macosx.x86_64_*|tail -1` -d MacOS
43
zip `ls exportRCP/repository/binary/org.txm.rcp.app_root.cocoa.macosx.x86_64_*|tail -1` -ur MacOS
44
rm -r MacOS
45

    
46
echo "Preparing GIT push..."
47
pushd $TXMGIT
48

    
49
if [ -z "$(git status --porcelain $TXMGIT)" ]; then 
50
	echo "GIT OK"
51
else 
52
	echo "Aborting GIT push: $TXMGIT repository is not clean."
53
	popd
54
	exit 1
55
fi
56

    
57
echo "rm previous version in `pwd`..."
58
git rm -r binary/*
59
git rm -r features/*
60
git rm -r plugins/*
61

    
62
pwd
63
echo "cp new build..."
64
cp -rf $CURRENTPATH/exportRCP/repository/* .
65

    
66
echo "git add commit push..."
67
git add --all .
68
git commit -m "push $LEVEL update of TXM-$VERSION"
69
git push
70

    
71
popd
72

    
73
echo "Done."