Statistics
| Revision:

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

History | View | Annotate | Download (1.6 kB)

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
if [ ! -d "$TXMGIT" ]; then
21
	echo "** Error the GIT directory does not exists: $TXMGIT"
22
	exit 1;
23
fi
24

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

    
30
echo "Preparing update files..."
31

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

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

    
44
echo "Preparing GIT push..."
45
pushd $TXMGIT
46

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

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

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

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

    
69
popd
70

    
71
echo "Done."