root / tmp / org.txm.setups / pushTXMUpdateToGIT.sh @ 3063
Historique | Voir | Annoter | Télécharger (1,64 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 | 3027 | mdecorde | if [ ! -d "$TXMGIT" ]; then |
21 | 3027 | mdecorde | echo "** Error the GIT directory does not exists: $TXMGIT" |
22 | 3027 | mdecorde | exit 1; |
23 | 3027 | mdecorde | fi |
24 | 3027 | mdecorde | |
25 | 3027 | mdecorde | if [ ! -d "$CURRENTPATH/exportRCP/repository" ]; then |
26 | 3027 | mdecorde | echo "** Error: no TXM repository build found: $CURRENTPATH/exportRCP/repository" |
27 | 3027 | mdecorde | exit 1; |
28 | 3027 | mdecorde | fi |
29 | 3027 | mdecorde | |
30 | 3035 | mdecorde | echo "Preparing update files..." |
31 | 3035 | mdecorde | |
32 | 3035 | mdecorde | MACOSXBUILD=`ls TXM_*_MacOSX/Applications/TXM-*.app/Contents/MacOS/TXM|tail -1` |
33 | 3035 | mdecorde | if [ "$MACOSXBUILD" = "" ]; then |
34 | 3035 | mdecorde | echo "Error: no MAc OS X build. Call BuildMacOSX before" |
35 | 3035 | mdecorde | return |
36 | 3035 | mdecorde | fi |
37 | 3035 | mdecorde | |
38 | 3035 | mdecorde | echo "Fixing Mac OS X binary archive..." |
39 | 3035 | mdecorde | cp -r `ls -d TXM_*_MacOSX/Applications/TXM-*.app/Contents/MacOS|tail -1` . |
40 | 3035 | mdecorde | zip `ls exportRCP/repository/binary/org.txm.rcp.app_root.cocoa.macosx.x86_64_*|tail -1` -d MacOS |
41 | 3035 | mdecorde | zip `ls exportRCP/repository/binary/org.txm.rcp.app_root.cocoa.macosx.x86_64_*|tail -1` -ur MacOS |
42 | 3035 | mdecorde | rm -r MacOS |
43 | 3035 | mdecorde | |
44 | 3027 | mdecorde | echo "Preparing GIT push..." |
45 | 3027 | mdecorde | pushd $TXMGIT |
46 | 3027 | mdecorde | |
47 | 3027 | mdecorde | if [ -z "$(git status --porcelain $TXMGIT)" ]; then |
48 | 3027 | mdecorde | echo "GIT OK" |
49 | 3027 | mdecorde | else |
50 | 3027 | mdecorde | echo "Aborting GIT push: $TXMGIT repository is not clean." |
51 | 3027 | mdecorde | popd |
52 | 3027 | mdecorde | exit 1 |
53 | 3027 | mdecorde | fi |
54 | 3027 | mdecorde | |
55 | 3054 | mdecorde | echo "rm previous version in `pwd`..." |
56 | 3054 | mdecorde | git rm -r binary/* |
57 | 3054 | mdecorde | git rm -r features/* |
58 | 3054 | mdecorde | git rm -r plugins/* |
59 | 3027 | mdecorde | |
60 | 3035 | mdecorde | pwd |
61 | 3035 | mdecorde | echo "cp new build..." |
62 | 3035 | mdecorde | cp -rf $CURRENTPATH/exportRCP/repository/* . |
63 | 3027 | mdecorde | |
64 | 3035 | mdecorde | echo "git add commit push..." |
65 | 3035 | mdecorde | git add --all . |
66 | 3027 | mdecorde | git commit -m "push $LEVEL update of TXM-$VERSION" |
67 | 3027 | mdecorde | git push |
68 | 3027 | mdecorde | |
69 | 3027 | mdecorde | popd |
70 | 3027 | mdecorde | |
71 | 3027 | mdecorde | echo "Done." |