mkdir -p tmp
version_from_git >"$version_file"
git rev-parse HEAD >git-commit.version
- if [[ "$BUILD_BUNDLE_PACKAGES" != 0 ]]; then
- bundle install --path vendor/bundle >"$STDOUT_IF_DEBUG"
- fi
+ bundle package --all
)
if [[ 0 != "$?" ]] || ! cd "$WORKSPACE/packages/$TARGET"; then
echo "ERROR: $pkgname package prep failed" >&2
local -a pos_args=("$srcdir/=$railsdir" "$pkgname" "Curoverse, Inc." dir
"$(cat "$version_file")")
local license_arg="$license_path=$railsdir/$(basename "$license_path")"
- # --iteration=3 accommodates the package scripts change from #8014.
- local -a switches=(--iteration=3
+ # --iteration=5 accommodates the package script bugfixes #8371 and #8413.
+ local -a switches=(--iteration=5
--after-install "$scripts_dir/postinst"
--before-remove "$scripts_dir/prerm"
--after-remove "$scripts_dir/postrm")
local exclude_root="${railsdir#/}"
# .git and packages are for the SSO server, which is built from its
# repository root.
- for exclude in .git packages tmp log coverage \
- vendor/cache/\* Capfile\* config/deploy\*; do
+ local -a exclude_list=(.git packages tmp log coverage Capfile\* \
+ config/deploy\* config/application.yml)
+ # for arvados-workbench, we need to have the (dummy) config/database.yml in the package
+ if [[ "$pkgname" != "arvados-workbench" ]]; then
+ exclude_list+=('config/database.yml')
+ fi
+ for exclude in ${exclude_list[@]}; do
switches+=(-x "$exclude_root/$exclude")
done
fpm_build "${pos_args[@]}" "${switches[@]}" \
-x "$exclude_root/vendor/bundle" "$@" "$license_arg"
- if [[ "$BUILD_BUNDLE_PACKAGES" != 0 ]]; then
- posargs[1]="$pkgname-with-bundle"
- fpm_build "${pos_args[@]}" "${switches[@]}" "$@" "$license_arg"
- fi
rm -rf "$scripts_dir" "$version_file"
}
declare -a COMMAND_ARR=("fpm" "--maintainer=Ward Vandewege <ward@curoverse.com>" "-s" "$PACKAGE_TYPE" "-t" "$FORMAT")
if [ python = "$PACKAGE_TYPE" ]; then
COMMAND_ARR+=(--exclude=\*/{dist,site}-packages/tests/\*)
+ if [ deb = "$FORMAT" ]; then
+ # Dependencies are built from setup.py. Since setup.py will never
+ # refer to Debian package iterations, it doesn't make sense to
+ # enforce those in the .deb dependencies.
+ COMMAND_ARR+=(--deb-ignore-iteration-in-dependencies)
+ fi
fi
if [[ "$PACKAGE_NAME" != "$PACKAGE" ]]; then
# that will take precedence, as desired.
COMMAND_ARR+=(--iteration "$(default_iteration "$PACKAGE" "$VERSION")")
- # Append remaining function arguments directly to fpm's command line.
- for i; do
- COMMAND_ARR+=("$i")
- done
+ # 'dir' type packages are provided in the form /path/to/source=/path/to/dest
+ # so strip off the 2nd part to check for fpm-info below.
+ PACKAGE_DIR=$(echo $PACKAGE | sed 's/\/=.*//')
# Append --depends X and other arguments specified by fpm-info.sh in
# the package source dir. These are added last so they can override
# the arguments added by this script.
declare -a fpm_args=()
declare -a fpm_depends=()
- if [[ -d "$PACKAGE" ]]; then
- FPM_INFO="$PACKAGE/fpm-info.sh"
+ declare -a fpm_exclude=()
+ if [[ -d "$PACKAGE_DIR" ]]; then
+ FPM_INFO="$PACKAGE_DIR/fpm-info.sh"
else
FPM_INFO="${WORKSPACE}/backports/${PACKAGE_TYPE}-${PACKAGE}/fpm-info.sh"
fi
for i in "${fpm_depends[@]}"; do
COMMAND_ARR+=('--depends' "$i")
done
+ for i in "${fpm_exclude[@]}"; do
+ COMMAND_ARR+=('--exclude' "$i")
+ done
+
+ # Append remaining function arguments directly to fpm's command line.
+ for i; do
+ COMMAND_ARR+=("$i")
+ done
+
COMMAND_ARR+=("${fpm_args[@]}")
COMMAND_ARR+=("$PACKAGE")