4 read -rd "\000" helpmessage <<EOF
5 $(basename $0): Build Arvados packages and (optionally) upload them.
8 WORKSPACE=/path/to/arvados $(basename $0) [options]
13 Upload packages (default: false)
15 Scp user for apt server (only required when --upload is specified)
17 Apt server hostname (only required when --upload is specified)
18 --build-bundle-packages (default: false)
19 Build api server and workbench packages with vendor/bundle included
21 Output debug information (default: false)
23 Package format (default: deb)
25 WORKSPACE=path Path to the Arvados source tree to build packages from
34 BUILD_BUNDLE_PACKAGES=0
42 echo >&2 "$helpmessage"
61 --build-bundle-packages)
62 BUILD_BUNDLE_PACKAGES=1
65 echo >&2 "$0: Unrecognized option: '$arg'. Try: $0 --help"
72 if [[ "$UPLOAD" != '0' && ("$APTUSER" == '' || "$APTSERVER" == '') ]]; then
73 echo >&2 "$helpmessage"
75 echo >&2 "Error: please specify --scp-user and --apt-server if --upload is set"
81 if ! [[ -n "$WORKSPACE" ]]; then
82 echo >&2 "$helpmessage"
84 echo >&2 "Error: WORKSPACE environment variable not set"
90 fpm --version >/dev/null 2>&1
92 if [[ "$?" != 0 ]]; then
93 echo >&2 "$helpmessage"
95 echo >&2 "Error: fpm not found"
100 if ! easy_install3 --version >/dev/null; then
104 Error: easy_install3 (from python3-setuptools) not found
110 RUN_BUILD_PACKAGES_PATH="`dirname \"$0\"`"
111 RUN_BUILD_PACKAGES_PATH="`( cd \"$RUN_BUILD_PACKAGES_PATH\" && pwd )`" # absolutized and normalized
112 if [ -z "$RUN_BUILD_PACKAGES_PATH" ] ; then
113 # error; for some reason, the path is not accessible
114 # to the script (e.g. permissions re-evaled after suid)
118 if [[ "$DEBUG" != 0 ]]; then
119 echo "$0 is running from $RUN_BUILD_PACKAGES_PATH"
120 echo "Workspace is $WORKSPACE"
124 # Generates a version number from the git log for the current working
125 # directory, and writes it to stdout.
126 local git_ts git_hash
127 declare $(TZ=UTC git log -n1 --first-parent --max-count=1 \
128 --format=format:"git_ts=%ct git_hash=%h" .)
129 echo "0.1.$(date -ud "@$git_ts" +%Y%m%d%H%M%S).$git_hash"
132 timestamp_from_git() {
133 # Generates a version number from the git log for the current working
134 # directory, and writes it to stdout.
135 local git_ts git_hash
136 declare $(TZ=UTC git log -n1 --first-parent --max-count=1 \
137 --format=format:"git_ts=%ct git_hash=%h" .)
141 handle_python_package () {
142 # This function assumes the current working directory is the python package directory
143 if [[ "$UPLOAD" != 0 ]]; then
144 # Make sure only to use sdist - that's the only format pip can deal with (sigh)
145 if [[ "$DEBUG" != 0 ]]; then
146 python setup.py sdist upload
148 python setup.py -q sdist upload
151 # Make sure only to use sdist - that's the only format pip can deal with (sigh)
152 if [[ "$DEBUG" != 0 ]]; then
153 python setup.py sdist
155 python setup.py -q sdist
160 # Build debs for everything
161 build_and_scp_deb () {
162 # The package source. Depending on the source type, this can be a
163 # path, or the name of the package in an upstream repository (e.g.,
167 # The name of the package to build. Defaults to $PACKAGE.
168 PACKAGE_NAME=${1:-$PACKAGE}
170 # Optional: the vendor of the package. Should be "Curoverse, Inc." for
171 # packages of our own software. Passed to fpm --vendor.
174 # The type of source package. Passed to fpm -s. Default "python".
175 PACKAGE_TYPE=${1:-python}
177 # Optional: the package version number. Passed to fpm -v.
181 # fpm does not actually support a python3 package type. Instead we recognize
182 # it as a convenience shortcut to add several necessary arguments to
183 # fpm's command line later, after we're done handling positional arguments.
184 if [ "python3" = "$PACKAGE_TYPE" ]; then
186 set -- "$@" --python-bin python3 --python-easyinstall easy_install3 \
187 --python-package-name-prefix python3 --depends python3
190 declare -a COMMAND_ARR=("fpm" "--maintainer=Ward Vandewege <ward@curoverse.com>" "-s" "$PACKAGE_TYPE" "-t" "$FORMAT" "-x" "usr/local/lib/python2.7/dist-packages/tests")
192 if [[ "$PACKAGE_NAME" != "$PACKAGE" ]]; then
193 COMMAND_ARR+=('-n' "$PACKAGE_NAME")
196 if [[ "$VENDOR" != "" ]]; then
197 COMMAND_ARR+=('--vendor' "$VENDOR")
200 if [[ "$VERSION" != "" ]]; then
201 COMMAND_ARR+=('-v' "$VERSION")
204 # Append remaining function arguments directly to fpm's command line.
209 COMMAND_ARR+=("$PACKAGE")
211 if [[ "$DEBUG" != 0 ]]; then
213 echo "${COMMAND_ARR[@]}"
217 FPM_RESULTS=$("${COMMAND_ARR[@]}")
220 verify_and_scp_deb $FPM_EXIT_CODE $FPM_RESULTS
223 # verify build results and scp debs, if needed
224 verify_and_scp_deb () {
230 if [[ $FPM_RESULTS =~ ([A-Za-z0-9_\-.]*\.)(deb|rpm) ]]; then
231 FPM_PACKAGE_NAME=${BASH_REMATCH[1]}${BASH_REMATCH[2]}
234 if [[ "$FPM_PACKAGE_NAME" == "" ]]; then
236 echo "Error: $PACKAGE: Unable to figure out package name from fpm results:"
241 if [[ ! $FPM_RESULTS =~ "File already exists" ]]; then
242 if [[ "$FPM_EXIT_CODE" != "0" ]]; then
243 echo "Error building package for $1:\n $FPM_RESULTS"
245 if [[ "$UPLOAD" != 0 ]]; then
246 if [[ "$FORMAT" == 'deb' ]]; then
247 scp -P2222 $FPM_PACKAGE_NAME $APTUSER@$APTSERVER:tmp/
249 scp -P2222 $FPM_PACKAGE_NAME $APTUSER@$APTSERVER:rpm/
255 echo "Package $FPM_PACKAGE_NAME exists, not rebuilding"
260 if [[ -f /etc/profile.d/rvm.sh ]]; then
261 source /etc/profile.d/rvm.sh
264 # Make all files world-readable -- jenkins runs with umask 027, and has checked
265 # out our git tree here
266 chmod o+r "$WORKSPACE" -R
268 # More cleanup - make sure all executables that we'll package are 755
269 find -type d -name 'bin' |xargs -I {} find {} -type f |xargs -I {} chmod 755 {}
271 # Now fix our umask to something better suited to building and publishing
275 if [[ "$DEBUG" != 0 ]]; then
276 echo "umask is" `umask`
280 if [[ "$DEBUG" != 0 ]]; then
281 echo -e "\nPerl packages\n"
284 if [[ "$DEBUG" != 0 ]]; then
290 cd "$WORKSPACE/sdk/perl"
292 if [[ -e Makefile ]]; then
293 make realclean >"$PERL_OUT"
295 find -maxdepth 1 \( -name 'MANIFEST*' -or -name 'libarvados-perl_*.deb' \) \
299 perl Makefile.PL >"$PERL_OUT" && \
300 make install PREFIX=install INSTALLDIRS=perl >"$PERL_OUT" && \
301 build_and_scp_deb install/=/usr libarvados-perl "Curoverse, Inc." dir \
302 "$(version_from_git)"
305 if [[ "$DEBUG" != 0 ]]; then
311 if type rvm-exec >/dev/null 2>&1; then
312 FPM_GEM_PREFIX=$(rvm-exec system gem environment gemdir)
314 FPM_GEM_PREFIX=$(gem environment gemdir)
319 # clean up old packages
320 find -maxdepth 1 \( -name 'arvados-*.gem' -or -name 'rubygem-arvados_*.deb' \) \
323 if [[ "$DEBUG" != 0 ]]; then
324 gem build arvados.gemspec
326 # -q appears to be broken in gem version 2.2.2
327 gem build arvados.gemspec -q >/dev/null 2>&1
330 if [[ "$UPLOAD" != 0 ]]; then
332 gem push arvados-*gem
335 build_and_scp_deb arvados-*.gem "" "Curoverse, Inc." gem "" \
336 --prefix "$FPM_GEM_PREFIX"
338 # Build arvados-cli GEM
342 rm -f arvados-cli*gem
344 if [[ "$DEBUG" != 0 ]]; then
345 gem build arvados-cli.gemspec
347 # -q appears to be broken in gem version 2.2.2
348 gem build arvados-cli.gemspec -q >/dev/null
351 if [[ "$UPLOAD" != 0 ]]; then
353 gem push arvados-cli*gem
357 if [[ "$DEBUG" != 0 ]]; then
359 echo "Python packages"
366 handle_python_package
368 cd ../../services/fuse
369 handle_python_package
371 cd ../../services/nodemanager
372 handle_python_package
374 if [[ ! -d "$WORKSPACE/debs" ]]; then
375 mkdir -p $WORKSPACE/debs
379 # We use $WORKSPACE/src-build-dir as the clean directory from which to build the src package
380 if [[ ! -d "$WORKSPACE/src-build-dir" ]]; then
381 mkdir "$WORKSPACE/src-build-dir"
383 if [[ "$DEBUG" != 0 ]]; then
384 git clone https://github.com/curoverse/arvados.git src-build-dir
386 git clone -q https://github.com/curoverse/arvados.git src-build-dir
390 cd "$WORKSPACE/src-build-dir"
391 # just in case, check out master
392 if [[ "$DEBUG" != 0 ]]; then
395 # go into detached-head state
396 git checkout `git log --format=format:%h -n1 .`
398 git checkout -q master
400 # go into detached-head state
401 git checkout -q `git log --format=format:%h -n1 .`
404 git log --format=format:%H -n1 . > git-commit.version
406 # Build arvados src deb package
408 PKG_VERSION=$(version_from_git)
410 build_and_scp_deb $WORKSPACE/src-build-dir/=/usr/local/arvados/src arvados-src 'Curoverse, Inc.' 'dir' "$PKG_VERSION" "--exclude=usr/local/arvados/src/.git" "--url=https://arvados.org" "--license=GNU Affero General Public License, version 3.0" "--description=The Arvados source code" "--architecture=all"
412 # clean up, check out master and step away from detached-head state
413 cd "$WORKSPACE/src-build-dir"
414 if [[ "$DEBUG" != 0 ]]; then
417 git checkout -q master
421 export GOPATH=$(mktemp -d)
422 mkdir -p "$GOPATH/src/git.curoverse.com"
423 ln -sfn "$WORKSPACE" "$GOPATH/src/git.curoverse.com/arvados.git"
426 cd "$GOPATH/src/git.curoverse.com/arvados.git/services/keepstore"
427 PKG_VERSION=$(version_from_git)
428 go get "git.curoverse.com/arvados.git/services/keepstore"
430 build_and_scp_deb $GOPATH/bin/keepstore=/usr/bin/keepstore keepstore 'Curoverse, Inc.' 'dir' "$PKG_VERSION" "--url=https://arvados.org" "--license=GNU Affero General Public License, version 3.0" "--description=Keepstore is the Keep storage daemon, accessible to clients on the LAN"
433 cd "$GOPATH/src/git.curoverse.com/arvados.git/sdk/go"
434 GO_SDK_VERSION=$(version_from_git)
435 GO_SDK_TIMESTAMP=$(timestamp_from_git)
438 cd "$GOPATH/src/git.curoverse.com/arvados.git/services/keepproxy"
439 KEEPPROXY_VERSION=$(version_from_git)
440 KEEPPROXY_TIMESTAMP=$(timestamp_from_git)
442 if [[ "$GO_SDK_TIMESTAMP" -gt "$KEEPPROXY_TIMESTAMP" ]]; then
443 PKG_VERSION=$GO_SDK_VERSION
445 PKG_VERSION=$KEEPPROXY_VERSION
448 go get "git.curoverse.com/arvados.git/services/keepproxy"
450 build_and_scp_deb $GOPATH/bin/keepproxy=/usr/bin/keepproxy keepproxy 'Curoverse, Inc.' 'dir' "$PKG_VERSION" "--url=https://arvados.org" "--license=GNU Affero General Public License, version 3.0" "--description=Keepproxy makes a Keep cluster accessible to clients that are not on the LAN"
453 cd "$GOPATH/src/git.curoverse.com/arvados.git/services/datamanager"
454 DATAMANAGER_VERSION=$(version_from_git)
455 DATAMANAGER_TIMESTAMP=$(timestamp_from_git)
457 if [[ "$GO_SDK_TIMESTAMP" -gt "$DATAMANAGER_TIMESTAMP" ]]; then
458 PKG_VERSION=$GO_SDK_VERSION
460 PKG_VERSION=$DATAMANAGER_VERSION
463 go get "git.curoverse.com/arvados.git/services/datamanager"
465 build_and_scp_deb $GOPATH/bin/datamanager=/usr/bin/arvados-data-manager arvados-data-manager 'Curoverse, Inc.' 'dir' "$PKG_VERSION" "--url=https://arvados.org" "--license=GNU Affero General Public License, version 3.0" "--description=Datamanager ensures block replication levels, reports on disk usage and determines which blocks should be deleted when space is needed."
468 cd "$GOPATH/src/git.curoverse.com/arvados.git/services/arv-git-httpd"
469 ARVGITHTTPD_VERSION=$(version_from_git)
470 ARVGITHTTPD_TIMESTAMP=$(timestamp_from_git)
472 if [[ "$GO_SDK_TIMESTAMP" -gt "$ARVGITHTTPD_TIMESTAMP" ]]; then
473 PKG_VERSION=$GO_SDK_VERSION
475 PKG_VERSION=$ARVGITHTTPD_VERSION
478 go get "git.curoverse.com/arvados.git/services/arv-git-httpd"
480 build_and_scp_deb $GOPATH/bin/arv-git-httpd=/usr/bin/arvados-git-httpd arvados-git-httpd 'Curoverse, Inc.' 'dir' "$PKG_VERSION" "--url=https://arvados.org" "--license=GNU Affero General Public License, version 3.0" "--description=Provides authenticated http access to Arvados-hosted git repositories."
483 cd "$GOPATH/src/git.curoverse.com/arvados.git/services/crunchstat"
484 PKG_VERSION=$(version_from_git)
485 go get "git.curoverse.com/arvados.git/services/crunchstat"
487 build_and_scp_deb $GOPATH/bin/crunchstat=/usr/bin/crunchstat crunchstat 'Curoverse, Inc.' 'dir' "$PKG_VERSION" "--url=https://arvados.org" "--license=GNU Affero General Public License, version 3.0" "--description=Crunchstat gathers cpu/memory/network statistics of running Crunch jobs"
490 # Please resist the temptation to add --no-python-fix-name to the fpm call here
491 # (which would remove the python- prefix from the package name), because this
492 # package is a dependency of arvados-fuse, and fpm can not omit the python-
493 # prefix from only one of the dependencies of a package... Maybe I could
494 # whip up a patch and send it upstream, but that will be for another day. Ward,
497 # Python version numbering is obscure. Strip dashes and replace them with dots
498 # to match our other version numbers. Cf. commit 4afcb8c, compliance with PEP-440.
499 build_and_scp_deb $WORKSPACE/sdk/python python-arvados-python-client 'Curoverse, Inc.' 'python' "$(awk '($1 == "Version:"){ gsub(/-/,".",$2); print $2 }' $WORKSPACE/sdk/python/arvados_python_client.egg-info/PKG-INFO)" "--url=https://arvados.org" "--description=The Arvados Python SDK"
502 # Please see comment about --no-python-fix-name above; we stay consistent and do
503 # not omit the python- prefix first.
505 # Python version numbering is obscure. Strip dashes and replace them with dots
506 # to match our other version numbers. Cf. commit 4afcb8c, compliance with PEP-440.
507 build_and_scp_deb $WORKSPACE/services/fuse python-arvados-fuse 'Curoverse, Inc.' 'python' "$(awk '($1 == "Version:"){ gsub(/-/,".",$2); print $2 }' $WORKSPACE/services/fuse/arvados_fuse.egg-info/PKG-INFO)" "--url=https://arvados.org" "--description=The Keep FUSE driver"
511 # Python version numbering is obscure. Strip dashes and replace them with dots
512 # to match our other version numbers. Cf. commit 4afcb8c, compliance with PEP-440.
513 build_and_scp_deb $WORKSPACE/services/nodemanager arvados-node-manager 'Curoverse, Inc.' 'python' "$(awk '($1 == "Version:"){ gsub(/-/,".",$2); print $2}' $WORKSPACE/services/nodemanager/arvados_node_manager.egg-info/PKG-INFO)" "--url=https://arvados.org" "--description=The Arvados node manager"
515 # The Docker image cleaner
517 build_and_scp_deb $WORKSPACE/services/dockercleaner arvados-docker-cleaner 'Curoverse, Inc.' 'python3' "$(awk '($1 == "Version:"){print $2}' $WORKSPACE/services/dockercleaner/arvados_docker_cleaner.egg-info/PKG-INFO)" "--url=https://arvados.org" "--description=The Arvados Docker image cleaner"
520 for deppkg in python-gflags pyvcf google-api-python-client oauth2client \
521 pyasn1 pyasn1-modules rsa uritemplate httplib2 ws4py virtualenv \
522 pykka apache-libcloud requests six pyexecjs jsonschema ciso8601 \
523 pycrypto backports.ssl_match_hostname; do
524 build_and_scp_deb "$deppkg"
527 # Python 3 dependencies
528 for deppkg in docker-py six requests; do
529 # The empty string is the vendor argument: these aren't Curoverse software.
530 build_and_scp_deb "$deppkg" "python3-$deppkg" "" python3
533 # Build the API server package
535 cd "$WORKSPACE/services/api"
537 API_VERSION=$(version_from_git)
538 PACKAGE_NAME=arvados-api-server
540 if [[ ! -d "$WORKSPACE/services/api/tmp" ]]; then
541 mkdir $WORKSPACE/services/api/tmp
544 BUNDLE_OUTPUT=`bundle install --path vendor/bundle`
546 if [[ "$DEBUG" != 0 ]]; then
550 /usr/bin/git rev-parse HEAD > git-commit.version
554 # Annoyingly, we require a database.yml file for rake assets:precompile to work. So for now,
555 # we do that in the upgrade script.
556 # TODO: add bogus database.yml file so we can precompile the assets and put them in the
557 # package. Then remove that database.yml file again. It has to be a valid file though.
558 #RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile
560 # This is the complete package with vendor/bundle included.
561 # It's big, so we do not build it by default.
562 if [[ "$BUILD_BUNDLE_PACKAGES" != 0 ]]; then
563 declare -a COMMAND_ARR=("fpm" "--maintainer=Ward Vandewege <ward@curoverse.com>" "--vendor='Curoverse, Inc.'" "--url='https://arvados.org'" "--description='Arvados API server - Arvados is a free and open source platform for big data science.'" "--license='GNU Affero General Public License, version 3.0'" "-s" "dir" "-t" "$FORMAT" "-n" "${PACKAGE_NAME}-with-bundle" "-v" "$API_VERSION" "-x" "var/www/arvados-api/current/tmp" "-x" "var/www/arvados-api/current/log" "-x" "var/www/arvados-api/current/vendor/cache/*" "-x" "var/www/arvados-api/current/coverage" "-x" "var/www/arvados-api/current/Capfile*" "-x" "var/www/arvados-api/current/config/deploy*" "--after-install=$RUN_BUILD_PACKAGES_PATH/arvados-api-server-extras/postinst.sh" "$WORKSPACE/services/api/=/var/www/arvados-api/current" "$RUN_BUILD_PACKAGES_PATH/arvados-api-server-extras/arvados-api-server-upgrade.sh=/usr/local/bin/arvados-api-server-upgrade.sh")
565 if [[ "$DEBUG" != 0 ]]; then
567 echo "${COMMAND_ARR[@]}"
571 FPM_RESULTS=$("${COMMAND_ARR[@]}")
573 verify_and_scp_deb $FPM_EXIT_CODE $FPM_RESULTS
576 # Build the 'bare' package without vendor/bundle.
577 declare -a COMMAND_ARR=("fpm" "--maintainer=Ward Vandewege <ward@curoverse.com>" "--vendor='Curoverse, Inc.'" "--url='https://arvados.org'" "--description='Arvados API server - Arvados is a free and open source platform for big data science.'" "--license='GNU Affero General Public License, version 3.0'" "-s" "dir" "-t" "$FORMAT" "-n" "${PACKAGE_NAME}" "-v" "$API_VERSION" "-x" "var/www/arvados-api/current/tmp" "-x" "var/www/arvados-api/current/log" "-x" "var/www/arvados-api/current/vendor/bundle" "-x" "var/www/arvados-api/current/vendor/cache/*" "-x" "var/www/arvados-api/current/coverage" "-x" "var/www/arvados-api/current/Capfile*" "-x" "var/www/arvados-api/current/config/deploy*" "--after-install=$RUN_BUILD_PACKAGES_PATH/arvados-api-server-extras/postinst.sh" "$WORKSPACE/services/api/=/var/www/arvados-api/current" "$RUN_BUILD_PACKAGES_PATH/arvados-api-server-extras/arvados-api-server-upgrade.sh=/usr/local/bin/arvados-api-server-upgrade.sh")
579 if [[ "$DEBUG" != 0 ]]; then
581 echo "${COMMAND_ARR[@]}"
585 FPM_RESULTS=$("${COMMAND_ARR[@]}")
587 verify_and_scp_deb $FPM_EXIT_CODE $FPM_RESULTS
589 # API server package build done
591 # Build the workbench server package
593 cd "$WORKSPACE/apps/workbench"
595 WORKBENCH_VERSION=$(version_from_git)
596 PACKAGE_NAME=arvados-workbench
598 if [[ ! -d "$WORKSPACE/apps/workbench/tmp" ]]; then
599 mkdir $WORKSPACE/apps/workbench/tmp
602 BUNDLE_OUTPUT=`bundle install --path vendor/bundle`
604 if [[ "$DEBUG" != 0 ]]; then
608 /usr/bin/git rev-parse HEAD > git-commit.version
610 # clear the tmp directory; the asset generation step will recreate tmp/cache/assets,
611 # and we want that in the package, so it's easier to not exclude the tmp directory
612 # from the package - empty it instead.
613 rm -rf $WORKSPACE/apps/workbench/tmp/*
615 RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile >/dev/null
619 # This is the complete package with vendor/bundle included.
620 # It's big, so we do not build it by default.
621 if [[ "$BUILD_BUNDLE_PACKAGES" != 0 ]]; then
623 declare -a COMMAND_ARR=("fpm" "--maintainer=Ward Vandewege <ward@curoverse.com>" "--vendor='Curoverse, Inc.'" "--url='https://arvados.org'" "--description='Arvados Workbench - Arvados is a free and open source platform for big data science.'" "--license='GNU Affero General Public License, version 3.0'" "-s" "dir" "-t" "$FORMAT" "-n" "${PACKAGE_NAME}-with-bundle" "-v" "$WORKBENCH_VERSION" "-x" "var/www/arvados-workbench/current/log" "-x" "var/www/arvados-workbench/current/vendor/cache/*" "-x" "var/www/arvados-workbench/current/coverage" "-x" "var/www/arvados-workbench/current/Capfile*" "-x" "var/www/arvados-workbench/current/config/deploy*" "--after-install=$RUN_BUILD_PACKAGES_PATH/arvados-workbench-extras/postinst.sh" "$WORKSPACE/apps/workbench/=/var/www/arvados-workbench/current" "$RUN_BUILD_PACKAGES_PATH/arvados-workbench-extras/arvados-workbench-upgrade.sh=/usr/local/bin/arvados-workbench-upgrade.sh")
625 if [[ "$DEBUG" != 0 ]]; then
627 echo "${COMMAND_ARR[@]}"
631 FPM_RESULTS=$("${COMMAND_ARR[@]}")
633 verify_and_scp_deb $FPM_EXIT_CODE $FPM_RESULTS
636 # Build the 'bare' package without vendor/bundle.
638 declare -a COMMAND_ARR=("fpm" "--maintainer=Ward Vandewege <ward@curoverse.com>" "--vendor='Curoverse, Inc.'" "--url='https://arvados.org'" "--description='Arvados Workbench - Arvados is a free and open source platform for big data science.'" "--license='GNU Affero General Public License, version 3.0'" "-s" "dir" "-t" "$FORMAT" "-n" "${PACKAGE_NAME}" "-v" "$WORKBENCH_VERSION" "-x" "var/www/arvados-workbench/current/log" "-x" "var/www/arvados-workbench/current/vendor/bundle" "-x" "var/www/arvados-workbench/current/vendor/cache/*" "-x" "var/www/arvados-workbench/current/coverage" "-x" "var/www/arvados-workbench/current/Capfile*" "-x" "var/www/arvados-workbench/current/config/deploy*" "--after-install=$RUN_BUILD_PACKAGES_PATH/arvados-workbench-extras/postinst.sh" "$WORKSPACE/apps/workbench/=/var/www/arvados-workbench/current" "$RUN_BUILD_PACKAGES_PATH/arvados-workbench-extras/arvados-workbench-upgrade.sh=/usr/local/bin/arvados-workbench-upgrade.sh")
640 if [[ "$DEBUG" != 0 ]]; then
642 echo "${COMMAND_ARR[@]}"
646 FPM_RESULTS=$("${COMMAND_ARR[@]}")
648 verify_and_scp_deb $FPM_EXIT_CODE $FPM_RESULTS
650 # Workbench package build done
652 # Finally, publish the packages, if necessary
653 if [[ "$UPLOAD" != 0 && "$CALL_FREIGHT" != 0 ]]; then
654 if [[ "$FORMAT" == 'deb' ]]; then
655 ssh -p2222 $APTUSER@$APTSERVER -t "cd tmp && ls -laF *deb && freight add *deb apt/wheezy && freight cache && rm -f *deb"
657 ssh -p2222 $APTUSER@$APTSERVER -t "cd rpm && ls -laF *rpm && mv *rpm /var/www/rpm.arvados.org/CentOS/6/os/x86_64/ && createrepo /var/www/rpm.arvados.org/CentOS/6/os/x86_64/"
660 if [[ "$UPLOAD" != 0 ]]; then
661 echo "No new packages generated. No freight run necessary."
665 # clean up temporary GOPATH