Add prerm and postrm scripts, various cleanups.
[arvados.git] / jenkins / run-build-packages-sso.sh
index da24867eb671090723cc81e695f79cf0210cc973..ada7a827e39087b795e45d30801ba5df5ef3e939 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-. ./run-library.sh
+. `dirname "$(readlink -f "$0")"`/run-library.sh
 
 read -rd "\000" helpmessage <<EOF
 $(basename $0): Build Arvados SSO package
@@ -173,19 +173,21 @@ fi
 
 cd $WORKSPACE/packages/$TARGET
 
-# Annoyingly, we require a database.yml file for rake assets:precompile to work. So for now,
-# we do that in the upgrade script.
+# Annoyingly, we require a database.yml file for rake assets:precompile to work.
+
 # TODO: add bogus database.yml file so we can precompile the assets and put them in the
 # package. Then remove that database.yml file again. It has to be a valid file though.
 #RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile
 
-# There are just 2 excludes left here, all the others are pulled in via fpm-info.sh.
-# The .git directory is excluded by git implicitly, so we can't pick it up from .gitignore.
-# The packages directory needs to be explictly excluded here because it will only be listed
+# There are just 2 excludes left here, all the others are pulled in via fpm-info.sh, which
+# takes .gitignore into account via a call to git status:
+#
+# 1. The .git directory is excluded by git implicitly, so we can't pick it up from .gitignore.
+# 2. The packages directory needs to be explictly excluded here because it will only be listed
 # if it exists at the time fpm-info.sh runs. If it does not exist at that time, this script
 # will create it and when fpm runs, it will include the directory. So we add it to the exclude
 # list explicitly here, just in case.
-declare -a COMMAND_ARR=("fpm" "--maintainer=Ward Vandewege <ward@curoverse.com>" "--vendor='Curoverse, Inc.'" "--url='https://arvados.org'" "--description='Arvados SSO server - Arvados is a free and open source platform for big data science.'" "--license='Expat License'" "-s" "dir" "-t" "$FORMAT" "-v" "$SSO_VERSION" "-x" "var/www/arvados-sso/current/.git" "-x" "var/www/arvados-sso/current/packages" "--after-install=$RUN_BUILD_PACKAGES_PATH/arvados-sso-server-extras/postinst.sh")
+declare -a COMMAND_ARR=("fpm" "--maintainer=Ward Vandewege <ward@curoverse.com>" "--vendor='Curoverse, Inc.'" "--url='https://arvados.org'" "--description='Arvados SSO server - Arvados is a free and open source platform for big data science.'" "--license='Expat License'" "-s" "dir" "-t" "$FORMAT" "-v" "$SSO_VERSION" "-x" "var/www/arvados-sso/current/.git" "-x" "var/www/arvados-sso/current/packages" "--after-install=$RUN_BUILD_PACKAGES_PATH/arvados-sso-server-extras/arvados-sso-server.postinst" "--before-remove=$RUN_BUILD_PACKAGES_PATH/arvados-sso-server-extras/arvados-sso-server.prerm" "--after-remove=$RUN_BUILD_PACKAGES_PATH/arvados-sso-server-extras/arvados-sso-server.postrm" )
 
 if [[ "$BUILD_BUNDLE_PACKAGES" != 0 ]]; then
   # This is the complete package with vendor/bundle included.
@@ -211,7 +213,7 @@ for i in "${fpm_depends[@]}"; do
   COMMAND_ARR+=('--depends' "$i")
 done
 COMMAND_ARR+=("${fpm_args[@]}")
-COMMAND_ARR+=("$WORKSPACE/=/var/www/arvados-sso/current" "$RUN_BUILD_PACKAGES_PATH/arvados-sso-server-extras/arvados-sso-server-upgrade.sh=/usr/local/bin/arvados-sso-server-upgrade.sh")
+COMMAND_ARR+=("$WORKSPACE/=/var/www/arvados-sso/current")
 debug_echo -e "\n${COMMAND_ARR[@]}\n"
 
 FPM_RESULTS=$("${COMMAND_ARR[@]}")