Statistiques
| Révision :

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

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

1
#!/bin/bash
2

    
3
if [ ! $# -eq 2 ]
4
  then
5
    echo "** Error: called with $# args. usage: 'pushTXMExtUpdateToGIT.sh VERSION LEVEL'"
6
    echo "** eg ./pushTXMUpdateToGIT.sh 0.8.1 alpha"
7
    exit 1
8
fi
9

    
10
echo "SCRIPT NOT FINISHED"
11
exit 1
12

    
13
CURRENTPATH="$(dirname $(realpath $0))"
14
echo "PATH='$PATH'"
15
VERSION=$1
16

    
17
LEVEL=$2
18
LEVEL="${LEVEL,,}"
19
TXMGITROOT=~/GIT/txm-software
20
TXMGITLOCAL="dist/$VERSION/ext/$LEVEL"
21
TXMGIT=$TXMGITROOT/$TXMGITLOCAL
22

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

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

    
33
echo "Preparing update files..."
34

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

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

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

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

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

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

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

    
72
popd
73

    
74
echo "Done."