9 if [[ "$APTUSER" == '' ]]; then
10 echo "Syntax: $0 <aptuser> <aptserver>"
14 if [[ "$APTSERVER" == '' ]]; then
15 echo "Syntax: $0 <aptuser> <aptserver>"
19 source /etc/profile.d/rvm.sh
23 echo "Build and publish ruby gem"
28 gem build arvados.gemspec
32 # Build arvados-cli GEM
33 echo "Build and publish ruby gem"
38 gem build arvados-cli.gemspec
40 gem push arvados-cli*gem
42 # Build arvados-python-client Python package
43 echo "Build and publish arvados-python-client package"
46 GIT_HASH=`git log --format=format:%ct.%h -n1 .`
50 # We mess with this file below, reset it here
53 # Make sure only to use sdist - that's the only format pip can deal with (sigh)
54 python setup.py egg_info -b ".$GIT_HASH" sdist upload
56 cd ../../services/fuse
58 # We mess with this file below, reset it here
61 # Make sure only to use sdist - that's the only format pip can deal with (sigh)
62 python setup.py egg_info -b ".$GIT_HASH" sdist upload
64 # Build debs for everything
66 build_and_scp_deb () {
69 # Put spaces in $3 and you will regret it. Despite the use of arrays below.
70 # Because, bash sucks.
75 if [[ "$PACKAGE_NAME" == "" ]]; then
79 if [[ "$PACKAGE_TYPE" == "" ]]; then
83 COMMAND_ARR=("fpm" "-s" "$PACKAGE_TYPE" "-t" "deb")
85 if [[ "$PACKAGE_NAME" != "$PACKAGE" ]]; then
86 COMMAND_ARR+=('-n' "$PACKAGE_NAME")
89 if [[ "$VENDOR" != "" ]]; then
90 COMMAND_ARR+=('--vendor' "$VENDOR")
92 for a in $EXTRA_ARGUMENTS; do
96 COMMAND_ARR+=("$PACKAGE")
98 FPM_RESULTS=$(${COMMAND_ARR[@]})
100 echo ${COMMAND_ARR[@]}
101 if [[ ! $FPM_RESULTS =~ "File already exists" ]]; then
102 if [[ "$FPM_EXIT_CODE" != "0" ]]; then
103 echo "Error building debian package for $1:\n $FPM_RESULTS"
105 scp -P2222 $PACKAGE_NAME*.deb $APTUSER@$APTSERVER:tmp/
109 echo "Debian package for $1 exists, not rebuilding"
113 if [[ ! -d "$WORKSPACE/debs" ]]; then
114 mkdir -p $WORKSPACE/debs
117 # Make sure our destination directory on $APTSERVER exists - prm can delete it when invoked improperly
118 ssh -p2222 $APTUSER@$APTSERVER mkdir tmp
121 cd $WORKSPACE/services/keep
124 build_and_scp_deb $WORKSPACE/services/keep/bin/keep=/usr/bin/keep keep 'Curoverse, Inc.' 'dir' "-v 0.1.$GIT_HASH"
128 # First build the keepclient library
130 ./go.sh install arvados.org/keepclient
133 cd $WORKSPACE/services/keep
134 ./go.sh install arvados.org/keepproxy
136 build_and_scp_deb $WORKSPACE/services/keep/bin/keepproxy=/usr/bin/keepproxy keepproxy 'Curoverse, Inc.' 'dir' "-v 0.1.$GIT_HASH"
138 # The crunchstat wrapper
139 cd $WORKSPACE/services/crunch/crunchstat
140 ./go.sh install arvados.org/crunchstat
142 build_and_scp_deb $WORKSPACE/services/crunch/crunchstat/bin/crunchstat=/usr/bin/crunchstat crunchstat 'Curoverse, Inc.' 'dir' "-v 0.1.$GIT_HASH"
145 cd $WORKSPACE/sdk/python
146 sed -i'' -e "s:version='0.1':version='0.1.$GIT_HASH':" setup.py
150 # Please resist the temptation to add --no-python-fix-name to the fpm call here
151 # (which would remove the python- prefix from the package name), because this
152 # package is a dependency of arvados-fuse, and fpm can not omit the python-
153 # prefix from only one of the dependencies of a package... Maybe I could
154 # whip up a patch and send it upstream, but that will be for another day. Ward,
156 build_and_scp_deb $WORKSPACE/sdk/python python-arvados-python-client 'Curoverse, Inc.' 'python' "-v 0.1.${GIT_HASH}"
159 cd $WORKSPACE/services/fuse
160 sed -i'' -e "s:version='0.1':version='0.1.$GIT_HASH':" setup.py
165 # Please seem comment about --no-python-fix-name above; we stay consistent and do
166 # not omit the python- prefix first.
167 build_and_scp_deb $WORKSPACE/services/fuse python-arvados-fuse 'Curoverse, Inc.' 'python' "-v 0.1.${GIT_HASH}"
170 build_and_scp_deb python-gflags
171 build_and_scp_deb pyvcf
172 build_and_scp_deb google-api-python-client
173 build_and_scp_deb httplib2
174 build_and_scp_deb ws4py
175 build_and_scp_deb virtualenv
177 # Finally, publish the packages, if necessary
178 if [[ "$CALL_PRM" != "0" ]]; then
179 ssh -p2222 $APTUSER@$APTSERVER -t "cd /var/www/$APTSERVER; /usr/local/rvm/bin/rvm default do prm --type deb -p . --component main --release wheezy --arch amd64 -d /home/$APTUSER/tmp/ --gpg 1078ECD7"
181 echo "No new packages generated. No PRM run necessary."