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 repository server (only required when --upload is specified)
17 scp host for repository server (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
37 PARSEDOPTS=$(getopt --name "$0" --longoptions \
38 help,upload,scp-user:,scp-host:,apt-server:,build-bundle-packages,debug,format: \
44 eval set -- "$PARSEDOPTS"
45 while [ $# -gt 0 ]; do
48 echo >&2 "$helpmessage"
55 --scp-host|--apt-server)
67 --build-bundle-packages)
68 BUILD_BUNDLE_PACKAGES=1
72 echo >&2 "$0: unrecognized argument '$2'. Try: $0 --help"
81 if [[ "$UPLOAD" != '0' && ("$SCPUSER" == '' || "$SCPHOST" == '') ]]; then
82 echo >&2 "$helpmessage"
84 echo >&2 "Error: please specify --scp-user and --scp-host if --upload is set"
90 if ! [[ -n "$WORKSPACE" ]]; then
91 echo >&2 "$helpmessage"
93 echo >&2 "Error: WORKSPACE environment variable not set"
99 fpm --version >/dev/null 2>&1
101 if [[ "$?" != 0 ]]; then
102 echo >&2 "$helpmessage"
104 echo >&2 "Error: fpm not found"
109 if ! easy_install3 --version >/dev/null; then
113 Error: easy_install3 (from python3-setuptools) not found
119 RUN_BUILD_PACKAGES_PATH="`dirname \"$0\"`"
120 RUN_BUILD_PACKAGES_PATH="`( cd \"$RUN_BUILD_PACKAGES_PATH\" && pwd )`" # absolutized and normalized
121 if [ -z "$RUN_BUILD_PACKAGES_PATH" ] ; then
122 # error; for some reason, the path is not accessible
123 # to the script (e.g. permissions re-evaled after suid)
127 if [[ "$DEBUG" != 0 ]]; then
128 echo "$0 is running from $RUN_BUILD_PACKAGES_PATH"
129 echo "Workspace is $WORKSPACE"
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" .)
138 echo "0.1.$(date -ud "@$git_ts" +%Y%m%d%H%M%S).$git_hash"
141 timestamp_from_git() {
142 # Generates a version number from the git log for the current working
143 # directory, and writes it to stdout.
144 local git_ts git_hash
145 declare $(TZ=UTC git log -n1 --first-parent --max-count=1 \
146 --format=format:"git_ts=%ct git_hash=%h" .)
150 handle_python_package () {
151 # This function assumes the current working directory is the python package directory
152 if [[ "$UPLOAD" != 0 ]]; then
153 # Make sure only to use sdist - that's the only format pip can deal with (sigh)
154 if [[ "$DEBUG" != 0 ]]; then
155 python setup.py sdist upload
157 python setup.py -q sdist upload
160 # Make sure only to use sdist - that's the only format pip can deal with (sigh)
161 if [[ "$DEBUG" != 0 ]]; then
162 python setup.py sdist
164 python setup.py -q sdist
169 # Build debs for everything
170 fpm_build_and_scp () {
171 # The package source. Depending on the source type, this can be a
172 # path, or the name of the package in an upstream repository (e.g.,
176 # The name of the package to build. Defaults to $PACKAGE.
177 PACKAGE_NAME=${1:-$PACKAGE}
179 # Optional: the vendor of the package. Should be "Curoverse, Inc." for
180 # packages of our own software. Passed to fpm --vendor.
183 # The type of source package. Passed to fpm -s. Default "python".
184 PACKAGE_TYPE=${1:-python}
186 # Optional: the package version number. Passed to fpm -v.
190 # fpm does not actually support a python3 package type. Instead we recognize
191 # it as a convenience shortcut to add several necessary arguments to
192 # fpm's command line later, after we're done handling positional arguments.
193 if [ "python3" = "$PACKAGE_TYPE" ]; then
195 set -- "$@" --python-bin python3 --python-easyinstall easy_install3 \
196 --python-package-name-prefix python3 --depends python3
199 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")
201 if [[ "$PACKAGE_NAME" != "$PACKAGE" ]]; then
202 COMMAND_ARR+=('-n' "$PACKAGE_NAME")
205 if [[ "$VENDOR" != "" ]]; then
206 COMMAND_ARR+=('--vendor' "$VENDOR")
209 if [[ "$VERSION" != "" ]]; then
210 COMMAND_ARR+=('-v' "$VERSION")
213 # Append remaining function arguments directly to fpm's command line.
218 COMMAND_ARR+=("$PACKAGE")
220 if [[ "$DEBUG" != 0 ]]; then
222 echo "${COMMAND_ARR[@]}"
226 FPM_RESULTS=$("${COMMAND_ARR[@]}")
229 fpm_verify_and_scp $FPM_EXIT_CODE $FPM_RESULTS
232 # verify build results and scp debs, if needed
233 fpm_verify_and_scp () {
239 if [[ $FPM_RESULTS =~ ([A-Za-z0-9_\-.]*\.)(deb|rpm) ]]; then
240 FPM_PACKAGE_NAME=${BASH_REMATCH[1]}${BASH_REMATCH[2]}
243 if [[ "$FPM_PACKAGE_NAME" == "" ]]; then
245 echo "Error: $PACKAGE: Unable to figure out package name from fpm results:"
250 if [[ ! $FPM_RESULTS =~ "File already exists" ]]; then
251 if [[ "$FPM_EXIT_CODE" != "0" ]]; then
252 echo "Error building package for $1:\n $FPM_RESULTS"
254 if [[ "$UPLOAD" != 0 ]]; then
255 if [[ "$FORMAT" == 'deb' ]]; then
256 scp -P2222 $FPM_PACKAGE_NAME $SCPUSER@$SCPHOST:tmp/
258 scp -P2222 $FPM_PACKAGE_NAME $SCPUSER@$SCPHOST:rpm/
264 echo "Package $FPM_PACKAGE_NAME exists, not rebuilding"
269 if [[ -f /etc/profile.d/rvm.sh ]]; then
270 source /etc/profile.d/rvm.sh
273 # Make all files world-readable -- jenkins runs with umask 027, and has checked
274 # out our git tree here
275 chmod o+r "$WORKSPACE" -R
277 # More cleanup - make sure all executables that we'll package are 755
278 find -type d -name 'bin' |xargs -I {} find {} -type f |xargs -I {} chmod 755 {}
280 # Now fix our umask to something better suited to building and publishing
284 if [[ "$DEBUG" != 0 ]]; then
285 echo "umask is" `umask`
289 if [[ "$DEBUG" != 0 ]]; then
290 echo -e "\nPerl packages\n"
293 if [[ "$DEBUG" != 0 ]]; then
299 cd "$WORKSPACE/sdk/perl"
301 if [[ -e Makefile ]]; then
302 make realclean >"$PERL_OUT"
304 find -maxdepth 1 \( -name 'MANIFEST*' -or -name 'libarvados-perl_*.deb' \) \
308 perl Makefile.PL >"$PERL_OUT" && \
309 make install PREFIX=install INSTALLDIRS=perl >"$PERL_OUT" && \
310 fpm_build_and_scp install/=/usr libarvados-perl "Curoverse, Inc." dir \
311 "$(version_from_git)"
314 if [[ "$DEBUG" != 0 ]]; then
320 if type rvm-exec >/dev/null 2>&1; then
321 FPM_GEM_PREFIX=$(rvm-exec system gem environment gemdir)
323 FPM_GEM_PREFIX=$(gem environment gemdir)
329 ARVADOS_GEM_EPOCH=`git log -n1 --first-parent --format=%ct`
330 ARVADOS_GEM_DATE=`date --utc --date="@${ARVADOS_GEM_EPOCH}" +%Y%m%d%H%M%S`
331 ARVADOS_GEM_VERSION="0.1.${ARVADOS_GEM_DATE}"
333 # see if this gem needs building/uploading
334 gem search arvados -r -a |grep -q $ARVADOS_GEM_VERSION
336 if [[ "$?" != "0" ]]; then
337 # clean up old packages
338 find -maxdepth 1 \( -name 'arvados-*.gem' -or -name 'rubygem-arvados_*.deb' -or -name 'rubygem-arvados_*.rpm' \) \
341 if [[ "$DEBUG" != 0 ]]; then
342 gem build arvados.gemspec
344 # -q appears to be broken in gem version 2.2.2
345 gem build arvados.gemspec -q >/dev/null 2>&1
348 if [[ "$UPLOAD" != 0 ]]; then
350 gem push arvados-*gem
353 fpm_build_and_scp arvados-*.gem "" "Curoverse, Inc." gem "" \
354 --prefix "$FPM_GEM_PREFIX"
357 # Build arvados-cli GEM
361 ARVADOS_CLI_GEM_EPOCH=`git log -n1 --first-parent --format=%ct`
362 ARVADOS_CLI_GEM_DATE=`date --utc --date="@${ARVADOS_CLI_GEM_EPOCH}" +%Y%m%d%H%M%S`
363 ARVADOS_CLI_GEM_VERSION="0.1.${ARVADOS_CLI_GEM_DATE}"
365 # see if this gem needs building/uploading
366 gem search arvados-cli -r -a |grep -q $ARVADOS_GEM_VERSION
368 if [[ "$?" != "0" ]]; then
370 rm -f arvados-cli*gem
372 if [[ "$DEBUG" != 0 ]]; then
373 gem build arvados-cli.gemspec
375 # -q appears to be broken in gem version 2.2.2
376 gem build arvados-cli.gemspec -q >/dev/null
379 if [[ "$UPLOAD" != 0 ]]; then
381 gem push arvados-cli*gem
386 if [[ "$DEBUG" != 0 ]]; then
388 echo "Python packages"
395 handle_python_package
397 cd ../../services/fuse
398 handle_python_package
400 cd ../../services/nodemanager
401 handle_python_package
403 if [[ ! -d "$WORKSPACE/debs" ]]; then
404 mkdir -p $WORKSPACE/debs
408 # We use $WORKSPACE/src-build-dir as the clean directory from which to build the src package
409 if [[ ! -d "$WORKSPACE/src-build-dir" ]]; then
410 mkdir "$WORKSPACE/src-build-dir"
412 if [[ "$DEBUG" != 0 ]]; then
413 git clone https://github.com/curoverse/arvados.git src-build-dir
415 git clone -q https://github.com/curoverse/arvados.git src-build-dir
419 cd "$WORKSPACE/src-build-dir"
420 # just in case, check out master
421 if [[ "$DEBUG" != 0 ]]; then
424 # go into detached-head state
425 git checkout `git log --format=format:%h -n1 .`
427 git checkout -q master
429 # go into detached-head state
430 git checkout -q `git log --format=format:%h -n1 .`
433 git log --format=format:%H -n1 . > git-commit.version
435 # Build arvados src deb package
437 PKG_VERSION=$(version_from_git)
439 fpm_build_and_scp $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"
441 # clean up, check out master and step away from detached-head state
442 cd "$WORKSPACE/src-build-dir"
443 if [[ "$DEBUG" != 0 ]]; then
446 git checkout -q master
450 export GOPATH=$(mktemp -d)
451 mkdir -p "$GOPATH/src/git.curoverse.com"
452 ln -sfn "$WORKSPACE" "$GOPATH/src/git.curoverse.com/arvados.git"
455 cd "$GOPATH/src/git.curoverse.com/arvados.git/services/keepstore"
456 PKG_VERSION=$(version_from_git)
457 go get "git.curoverse.com/arvados.git/services/keepstore"
459 fpm_build_and_scp $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"
462 cd "$GOPATH/src/git.curoverse.com/arvados.git/sdk/go"
463 GO_SDK_VERSION=$(version_from_git)
464 GO_SDK_TIMESTAMP=$(timestamp_from_git)
467 cd "$GOPATH/src/git.curoverse.com/arvados.git/services/keepproxy"
468 KEEPPROXY_VERSION=$(version_from_git)
469 KEEPPROXY_TIMESTAMP=$(timestamp_from_git)
471 if [[ "$GO_SDK_TIMESTAMP" -gt "$KEEPPROXY_TIMESTAMP" ]]; then
472 PKG_VERSION=$GO_SDK_VERSION
474 PKG_VERSION=$KEEPPROXY_VERSION
477 go get "git.curoverse.com/arvados.git/services/keepproxy"
479 fpm_build_and_scp $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"
482 cd "$GOPATH/src/git.curoverse.com/arvados.git/services/datamanager"
483 DATAMANAGER_VERSION=$(version_from_git)
484 DATAMANAGER_TIMESTAMP=$(timestamp_from_git)
486 if [[ "$GO_SDK_TIMESTAMP" -gt "$DATAMANAGER_TIMESTAMP" ]]; then
487 PKG_VERSION=$GO_SDK_VERSION
489 PKG_VERSION=$DATAMANAGER_VERSION
492 go get "git.curoverse.com/arvados.git/services/datamanager"
494 fpm_build_and_scp $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."
497 cd "$GOPATH/src/git.curoverse.com/arvados.git/services/arv-git-httpd"
498 ARVGITHTTPD_VERSION=$(version_from_git)
499 ARVGITHTTPD_TIMESTAMP=$(timestamp_from_git)
501 if [[ "$GO_SDK_TIMESTAMP" -gt "$ARVGITHTTPD_TIMESTAMP" ]]; then
502 PKG_VERSION=$GO_SDK_VERSION
504 PKG_VERSION=$ARVGITHTTPD_VERSION
507 go get "git.curoverse.com/arvados.git/services/arv-git-httpd"
509 fpm_build_and_scp $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."
512 cd "$GOPATH/src/git.curoverse.com/arvados.git/services/crunchstat"
513 PKG_VERSION=$(version_from_git)
514 go get "git.curoverse.com/arvados.git/services/crunchstat"
516 fpm_build_and_scp $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"
519 # Please resist the temptation to add --no-python-fix-name to the fpm call here
520 # (which would remove the python- prefix from the package name), because this
521 # package is a dependency of arvados-fuse, and fpm can not omit the python-
522 # prefix from only one of the dependencies of a package... Maybe I could
523 # whip up a patch and send it upstream, but that will be for another day. Ward,
526 # Python version numbering is obscure. Strip dashes and replace them with dots
527 # to match our other version numbers. Cf. commit 4afcb8c, compliance with PEP-440.
528 fpm_build_and_scp $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"
531 # Please see comment about --no-python-fix-name above; we stay consistent and do
532 # not omit the python- prefix first.
534 # Python version numbering is obscure. Strip dashes and replace them with dots
535 # to match our other version numbers. Cf. commit 4afcb8c, compliance with PEP-440.
536 fpm_build_and_scp $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"
540 # Python version numbering is obscure. Strip dashes and replace them with dots
541 # to match our other version numbers. Cf. commit 4afcb8c, compliance with PEP-440.
542 fpm_build_and_scp $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"
544 # The Docker image cleaner
546 fpm_build_and_scp $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"
549 for deppkg in python-gflags pyvcf google-api-python-client oauth2client \
550 pyasn1 pyasn1-modules rsa uritemplate httplib2 ws4py virtualenv \
551 pykka apache-libcloud requests six pyexecjs jsonschema ciso8601 \
552 pycrypto backports.ssl_match_hostname; do
553 fpm_build_and_scp "$deppkg"
556 # Python 3 dependencies
557 for deppkg in docker-py six requests; do
558 # The empty string is the vendor argument: these aren't Curoverse software.
559 fpm_build_and_scp "$deppkg" "python3-$deppkg" "" python3
562 # Build the API server package
564 cd "$WORKSPACE/services/api"
566 API_VERSION=$(version_from_git)
567 PACKAGE_NAME=arvados-api-server
569 if [[ ! -d "$WORKSPACE/services/api/tmp" ]]; then
570 mkdir $WORKSPACE/services/api/tmp
573 BUNDLE_OUTPUT=`bundle install --path vendor/bundle`
575 if [[ "$DEBUG" != 0 ]]; then
579 /usr/bin/git rev-parse HEAD > git-commit.version
583 # Annoyingly, we require a database.yml file for rake assets:precompile to work. So for now,
584 # we do that in the upgrade script.
585 # TODO: add bogus database.yml file so we can precompile the assets and put them in the
586 # package. Then remove that database.yml file again. It has to be a valid file though.
587 #RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile
589 # This is the complete package with vendor/bundle included.
590 # It's big, so we do not build it by default.
591 if [[ "$BUILD_BUNDLE_PACKAGES" != 0 ]]; then
592 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")
594 if [[ "$DEBUG" != 0 ]]; then
596 echo "${COMMAND_ARR[@]}"
600 FPM_RESULTS=$("${COMMAND_ARR[@]}")
602 fpm_verify_and_scp $FPM_EXIT_CODE $FPM_RESULTS
605 # Build the 'bare' package without vendor/bundle.
606 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")
608 if [[ "$DEBUG" != 0 ]]; then
610 echo "${COMMAND_ARR[@]}"
614 FPM_RESULTS=$("${COMMAND_ARR[@]}")
616 fpm_verify_and_scp $FPM_EXIT_CODE $FPM_RESULTS
618 # API server package build done
620 # Build the workbench server package
622 cd "$WORKSPACE/apps/workbench"
624 WORKBENCH_VERSION=$(version_from_git)
625 PACKAGE_NAME=arvados-workbench
627 if [[ ! -d "$WORKSPACE/apps/workbench/tmp" ]]; then
628 mkdir $WORKSPACE/apps/workbench/tmp
631 BUNDLE_OUTPUT=`bundle install --path vendor/bundle`
633 if [[ "$DEBUG" != 0 ]]; then
637 /usr/bin/git rev-parse HEAD > git-commit.version
639 # clear the tmp directory; the asset generation step will recreate tmp/cache/assets,
640 # and we want that in the package, so it's easier to not exclude the tmp directory
641 # from the package - empty it instead.
642 rm -rf $WORKSPACE/apps/workbench/tmp/*
644 # Set up application.yml so that asset precompilation works
645 \cp config/application.yml.example config/application.yml -f
646 sed -i 's/secret_token: ~/secret_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/' config/application.yml
648 RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile >/dev/null
650 if [[ "$?" != "0" ]]; then
651 echo "ERROR: Asset precompilation failed"
657 # This is the complete package with vendor/bundle included.
658 # It's big, so we do not build it by default.
659 if [[ "$BUILD_BUNDLE_PACKAGES" != 0 ]]; then
661 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")
663 if [[ "$DEBUG" != 0 ]]; then
665 echo "${COMMAND_ARR[@]}"
669 FPM_RESULTS=$("${COMMAND_ARR[@]}")
671 fpm_verify_and_scp $FPM_EXIT_CODE $FPM_RESULTS
674 # Build the 'bare' package without vendor/bundle.
676 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")
678 if [[ "$DEBUG" != 0 ]]; then
680 echo "${COMMAND_ARR[@]}"
684 FPM_RESULTS=$("${COMMAND_ARR[@]}")
686 fpm_verify_and_scp $FPM_EXIT_CODE $FPM_RESULTS
688 # Workbench package build done
690 # Finally, publish the packages, if necessary
691 if [[ "$UPLOAD" != 0 && "$CALL_FREIGHT" != 0 ]]; then
692 if [[ "$FORMAT" == 'deb' ]]; then
693 ssh -p2222 $SCPUSER@$SCPHOST -t "cd tmp && ls -laF *deb && freight add *deb apt/wheezy && freight cache && rm -f *deb"
695 ssh -p2222 $SCPUSER@$SCPHOST -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/"
698 if [[ "$UPLOAD" != 0 ]]; then
699 echo "No new packages generated. No freight run necessary."
703 # clean up temporary GOPATH