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)
320 ARVADOS_GEM_EPOCH=`git log -n1 --first-parent --format=%ct`
321 ARVADOS_GEM_DATE=`date --utc --date="@${ARVADOS_GEM_EPOCH}" +%Y%m%d%H%M%S`
322 ARVADOS_GEM_VERSION="0.1.${ARVADOS_GEM_DATE}"
324 # see if this gem needs building/uploading
325 gem search arvados -r -a |grep -q $ARVADOS_GEM_VERSION
327 if [[ "$?" != "0" ]]; then
328 # clean up old packages
329 find -maxdepth 1 \( -name 'arvados-*.gem' -or -name 'rubygem-arvados_*.deb' -or -name 'rubygem-arvados_*.rpm' \) \
332 if [[ "$DEBUG" != 0 ]]; then
333 gem build arvados.gemspec
335 # -q appears to be broken in gem version 2.2.2
336 gem build arvados.gemspec -q >/dev/null 2>&1
339 if [[ "$UPLOAD" != 0 ]]; then
341 gem push arvados-*gem
344 build_and_scp_deb arvados-*.gem "" "Curoverse, Inc." gem "" \
345 --prefix "$FPM_GEM_PREFIX"
348 # Build arvados-cli GEM
352 ARVADOS_CLI_GEM_EPOCH=`git log -n1 --first-parent --format=%ct`
353 ARVADOS_CLI_GEM_DATE=`date --utc --date="@${ARVADOS_CLI_GEM_EPOCH}" +%Y%m%d%H%M%S`
354 ARVADOS_CLI_GEM_VERSION="0.1.${ARVADOS_CLI_GEM_DATE}"
356 # see if this gem needs building/uploading
357 gem search arvados-cli -r -a |grep -q $ARVADOS_GEM_VERSION
359 if [[ "$?" != "0" ]]; then
361 rm -f arvados-cli*gem
363 if [[ "$DEBUG" != 0 ]]; then
364 gem build arvados-cli.gemspec
366 # -q appears to be broken in gem version 2.2.2
367 gem build arvados-cli.gemspec -q >/dev/null
370 if [[ "$UPLOAD" != 0 ]]; then
372 gem push arvados-cli*gem
377 if [[ "$DEBUG" != 0 ]]; then
379 echo "Python packages"
386 handle_python_package
388 cd ../../services/fuse
389 handle_python_package
391 cd ../../services/nodemanager
392 handle_python_package
394 if [[ ! -d "$WORKSPACE/debs" ]]; then
395 mkdir -p $WORKSPACE/debs
399 # We use $WORKSPACE/src-build-dir as the clean directory from which to build the src package
400 if [[ ! -d "$WORKSPACE/src-build-dir" ]]; then
401 mkdir "$WORKSPACE/src-build-dir"
403 if [[ "$DEBUG" != 0 ]]; then
404 git clone https://github.com/curoverse/arvados.git src-build-dir
406 git clone -q https://github.com/curoverse/arvados.git src-build-dir
410 cd "$WORKSPACE/src-build-dir"
411 # just in case, check out master
412 if [[ "$DEBUG" != 0 ]]; then
415 # go into detached-head state
416 git checkout `git log --format=format:%h -n1 .`
418 git checkout -q master
420 # go into detached-head state
421 git checkout -q `git log --format=format:%h -n1 .`
424 git log --format=format:%H -n1 . > git-commit.version
426 # Build arvados src deb package
428 PKG_VERSION=$(version_from_git)
430 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"
432 # clean up, check out master and step away from detached-head state
433 cd "$WORKSPACE/src-build-dir"
434 if [[ "$DEBUG" != 0 ]]; then
437 git checkout -q master
441 export GOPATH=$(mktemp -d)
442 mkdir -p "$GOPATH/src/git.curoverse.com"
443 ln -sfn "$WORKSPACE" "$GOPATH/src/git.curoverse.com/arvados.git"
446 cd "$GOPATH/src/git.curoverse.com/arvados.git/services/keepstore"
447 PKG_VERSION=$(version_from_git)
448 go get "git.curoverse.com/arvados.git/services/keepstore"
450 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"
453 cd "$GOPATH/src/git.curoverse.com/arvados.git/sdk/go"
454 GO_SDK_VERSION=$(version_from_git)
455 GO_SDK_TIMESTAMP=$(timestamp_from_git)
458 cd "$GOPATH/src/git.curoverse.com/arvados.git/services/keepproxy"
459 KEEPPROXY_VERSION=$(version_from_git)
460 KEEPPROXY_TIMESTAMP=$(timestamp_from_git)
462 if [[ "$GO_SDK_TIMESTAMP" -gt "$KEEPPROXY_TIMESTAMP" ]]; then
463 PKG_VERSION=$GO_SDK_VERSION
465 PKG_VERSION=$KEEPPROXY_VERSION
468 go get "git.curoverse.com/arvados.git/services/keepproxy"
470 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"
473 cd "$GOPATH/src/git.curoverse.com/arvados.git/services/datamanager"
474 DATAMANAGER_VERSION=$(version_from_git)
475 DATAMANAGER_TIMESTAMP=$(timestamp_from_git)
477 if [[ "$GO_SDK_TIMESTAMP" -gt "$DATAMANAGER_TIMESTAMP" ]]; then
478 PKG_VERSION=$GO_SDK_VERSION
480 PKG_VERSION=$DATAMANAGER_VERSION
483 go get "git.curoverse.com/arvados.git/services/datamanager"
485 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."
488 cd "$GOPATH/src/git.curoverse.com/arvados.git/services/arv-git-httpd"
489 ARVGITHTTPD_VERSION=$(version_from_git)
490 ARVGITHTTPD_TIMESTAMP=$(timestamp_from_git)
492 if [[ "$GO_SDK_TIMESTAMP" -gt "$ARVGITHTTPD_TIMESTAMP" ]]; then
493 PKG_VERSION=$GO_SDK_VERSION
495 PKG_VERSION=$ARVGITHTTPD_VERSION
498 go get "git.curoverse.com/arvados.git/services/arv-git-httpd"
500 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."
503 cd "$GOPATH/src/git.curoverse.com/arvados.git/services/crunchstat"
504 PKG_VERSION=$(version_from_git)
505 go get "git.curoverse.com/arvados.git/services/crunchstat"
507 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"
510 # Please resist the temptation to add --no-python-fix-name to the fpm call here
511 # (which would remove the python- prefix from the package name), because this
512 # package is a dependency of arvados-fuse, and fpm can not omit the python-
513 # prefix from only one of the dependencies of a package... Maybe I could
514 # whip up a patch and send it upstream, but that will be for another day. Ward,
517 # Python version numbering is obscure. Strip dashes and replace them with dots
518 # to match our other version numbers. Cf. commit 4afcb8c, compliance with PEP-440.
519 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"
522 # Please see comment about --no-python-fix-name above; we stay consistent and do
523 # not omit the python- prefix first.
525 # Python version numbering is obscure. Strip dashes and replace them with dots
526 # to match our other version numbers. Cf. commit 4afcb8c, compliance with PEP-440.
527 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"
531 # Python version numbering is obscure. Strip dashes and replace them with dots
532 # to match our other version numbers. Cf. commit 4afcb8c, compliance with PEP-440.
533 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"
535 # The Docker image cleaner
537 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"
540 for deppkg in python-gflags pyvcf google-api-python-client oauth2client \
541 pyasn1 pyasn1-modules rsa uritemplate httplib2 ws4py virtualenv \
542 pykka apache-libcloud requests six pyexecjs jsonschema ciso8601 \
543 pycrypto backports.ssl_match_hostname; do
544 build_and_scp_deb "$deppkg"
547 # Python 3 dependencies
548 for deppkg in docker-py six requests; do
549 # The empty string is the vendor argument: these aren't Curoverse software.
550 build_and_scp_deb "$deppkg" "python3-$deppkg" "" python3
553 # Build the API server package
555 cd "$WORKSPACE/services/api"
557 API_VERSION=$(version_from_git)
558 PACKAGE_NAME=arvados-api-server
560 if [[ ! -d "$WORKSPACE/services/api/tmp" ]]; then
561 mkdir $WORKSPACE/services/api/tmp
564 BUNDLE_OUTPUT=`bundle install --path vendor/bundle`
566 if [[ "$DEBUG" != 0 ]]; then
570 /usr/bin/git rev-parse HEAD > git-commit.version
574 # Annoyingly, we require a database.yml file for rake assets:precompile to work. So for now,
575 # we do that in the upgrade script.
576 # TODO: add bogus database.yml file so we can precompile the assets and put them in the
577 # package. Then remove that database.yml file again. It has to be a valid file though.
578 #RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile
580 # This is the complete package with vendor/bundle included.
581 # It's big, so we do not build it by default.
582 if [[ "$BUILD_BUNDLE_PACKAGES" != 0 ]]; then
583 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")
585 if [[ "$DEBUG" != 0 ]]; then
587 echo "${COMMAND_ARR[@]}"
591 FPM_RESULTS=$("${COMMAND_ARR[@]}")
593 verify_and_scp_deb $FPM_EXIT_CODE $FPM_RESULTS
596 # Build the 'bare' package without vendor/bundle.
597 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")
599 if [[ "$DEBUG" != 0 ]]; then
601 echo "${COMMAND_ARR[@]}"
605 FPM_RESULTS=$("${COMMAND_ARR[@]}")
607 verify_and_scp_deb $FPM_EXIT_CODE $FPM_RESULTS
609 # API server package build done
611 # Build the workbench server package
613 cd "$WORKSPACE/apps/workbench"
615 WORKBENCH_VERSION=$(version_from_git)
616 PACKAGE_NAME=arvados-workbench
618 if [[ ! -d "$WORKSPACE/apps/workbench/tmp" ]]; then
619 mkdir $WORKSPACE/apps/workbench/tmp
622 BUNDLE_OUTPUT=`bundle install --path vendor/bundle`
624 if [[ "$DEBUG" != 0 ]]; then
628 /usr/bin/git rev-parse HEAD > git-commit.version
630 # clear the tmp directory; the asset generation step will recreate tmp/cache/assets,
631 # and we want that in the package, so it's easier to not exclude the tmp directory
632 # from the package - empty it instead.
633 rm -rf $WORKSPACE/apps/workbench/tmp/*
635 RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile >/dev/null
639 # This is the complete package with vendor/bundle included.
640 # It's big, so we do not build it by default.
641 if [[ "$BUILD_BUNDLE_PACKAGES" != 0 ]]; then
643 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")
645 if [[ "$DEBUG" != 0 ]]; then
647 echo "${COMMAND_ARR[@]}"
651 FPM_RESULTS=$("${COMMAND_ARR[@]}")
653 verify_and_scp_deb $FPM_EXIT_CODE $FPM_RESULTS
656 # Build the 'bare' package without vendor/bundle.
658 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")
660 if [[ "$DEBUG" != 0 ]]; then
662 echo "${COMMAND_ARR[@]}"
666 FPM_RESULTS=$("${COMMAND_ARR[@]}")
668 verify_and_scp_deb $FPM_EXIT_CODE $FPM_RESULTS
670 # Workbench package build done
672 # Finally, publish the packages, if necessary
673 if [[ "$UPLOAD" != 0 && "$CALL_FREIGHT" != 0 ]]; then
674 if [[ "$FORMAT" == 'deb' ]]; then
675 ssh -p2222 $APTUSER@$APTSERVER -t "cd tmp && ls -laF *deb && freight add *deb apt/wheezy && freight cache && rm -f *deb"
677 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/"
680 if [[ "$UPLOAD" != 0 ]]; then
681 echo "No new packages generated. No freight run necessary."
685 # clean up temporary GOPATH