1 - | #!/usr/bin/env bash |
2 - | |
3 - | |
4 - | |
5 - | |
6 - | |
7 - | |
8 - | wheeldirectory=$1 |
9 - | branch=$2 |
10 - | casalithbranch=$3 |
11 - | signature=$4 |
12 - | OS=`uname` |
13 - | |
14 - | echo "wheeldirectory: $wheeldirectory" |
15 - | echo "branch: $branch" |
16 - | echo "casalithbranch: $casalithbranch" |
17 - | echo "OS: $OS" |
18 - | |
19 - | |
20 - | |
21 - | toolswheel=$wheeldirectory/`ls $wheeldirectory | grep casatools` |
22 - | taskswheel=$wheeldirectory/`ls $wheeldirectory | grep casatasks` |
23 - | shellwheel=$wheeldirectory/`ls $wheeldirectory | grep casashell` |
24 - | testutilswheel=$wheeldirectory/`ls $wheeldirectory | grep casatestutils` |
25 - | |
26 - | echo "Tools: $toolswheel" |
27 - | echo "Tasks: $taskswheel" |
28 - | echo "Shell: $shellwheel" |
29 - | echo "Casatestutils: $testutilswheel" |
30 - | |
31 - | echo Working directory: `pwd` |
32 - | |
33 - | git clone --recursive https://open-bitbucket.nrao.edu/scm/casa/casalith.git |
34 - | cd casalith |
35 - | git checkout $casalithbranch |
36 - | rc=$? |
37 - | if [[ $rc != 0 ]]; then |
38 - | echo "Failed to checkout casalith branch $casalithbranch. Continuing packaging with casalith master" |
39 - | fi |
40 - | git submodule update --recursive |
41 - | cd .. |
42 - | |
43 - | export PYTHONNOUSERSITE=1 |
44 - | python -m venv casalith_venv |
45 - | source casalith_venv/bin/activate |
46 - | |
47 - | if [ "$branch" == "master" ]; then |
48 - | cd casalith/build-casalith && ./generate-distro tools=$toolswheel tasks=$taskswheel shell=$shellwheel testutils=$testutilswheel clone=https://open-bitbucket.nrao.edu/scm/casa/casa6.git branch=$branch --use-nrao-index |
49 - | cd - |
50 - | elif [[ "$branch" =~ ^release.* ]];then |
51 - | cd casalith/build-casalith && ./generate-distro tools=$toolswheel tasks=$taskswheel shell=$shellwheel testutils=$testutilswheel clone=https://open-bitbucket.nrao.edu/scm/casa/casa6.git branch=$branch --use-nrao-index |
52 - | cd - |
53 - | elif [[ "$branch" =~ ^CAS-.* ]];then |
54 - | revision=`perl getdevpackagerevision.pl shell=$shellwheel` |
55 - | cd casalith/build-casalith && ./generate-distro tools=$toolswheel tasks=$taskswheel shell=$shellwheel testutils=$testutilswheel clone=https://open-bitbucket.nrao.edu/scm/casa/casa6.git branch=$branch --use-nrao-index |
56 - | cd - |
57 - | cd casalith/build-casalith/work/$OS/output |
58 - | |
59 - | old=$(ls . | grep "casa-*"| tr "/" " ") |
60 - | mv $old casa-$branch-$revision |
61 - | cd - |
62 - | else |
63 - | revision=`perl getdevpackagerevision.pl shell=$shellwheel` |
64 - | version=`perl getdevpackageversion.pl shell=$shellwheel` |
65 - | cd casalith/build-casalith && ./generate-distro tools=$toolswheel tasks=$taskswheel shell=$shellwheel testutils=$testutilswheel clone=https://open-bitbucket.nrao.edu/scm/casa/casa6.git branch=$branch version=$version-$branch-$revision --use-nrao-index |
66 - | cd - |
67 - | cd casalith/build-casalith/work/$OS/output |
68 - | |
69 - | old=$(ls . | grep "casa-*"| tr "/" " ") |
70 - | mv $old casa-$branch-$revision |
71 - | cd - |
72 - | fi |
73 - | deactivate |
74 - | rm -rf casalith_venv |
75 - | perl sign.pl casalith/build-casalith/work/darwin/output/CASA.app $signature |
76 - | package_id=`perl getmacpackagename.pl shell=$shellwheel` |
77 - | |
78 - | casalith/build-casalith/work/darwin/output/CASA.app/Contents/MacOS/casa -c "exit()" |
79 - | casalith/build-casalith/work/casa-pkg/packaging/scripts/make-dmg casalith/build-casalith/work/darwin/output/CASA.app $package_id |