Skip to content

Commit 85d051b

Browse files
committed
Capistrano deployments postgresql library configuration
Bump ndr_dev_support to 7.3.4
1 parent 7ec7639 commit 85d051b

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ GEM
172172
mocha (2.7.1)
173173
ruby2_keywords (>= 0.0.5)
174174
msgpack (1.8.0)
175-
ndr_dev_support (7.3.3)
175+
ndr_dev_support (7.3.4)
176176
activesupport (>= 6.1, < 8.1)
177177
brakeman (>= 4.7.1)
178178
bundler-audit

config/deploy.rb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Avoid spurious deprecation warning on STDERR with capistrano 2 and bundler 2.x
2+
set :bundle_cmd, 'BUNDLE_SILENCE_DEPRECATIONS=true bundle'
3+
14
require 'bundler/capistrano'
25
require 'ndr_dev_support/capistrano/ndr_model'
36

@@ -51,8 +54,20 @@
5154
task :configure do
5255
# We need to use local configuration, because global configuration will be "global" for the
5356
# deploying user, rather than the application user.
57+
# You can override the path using e.g. set :pg_conf_path, '/usr/pgsql-9.5/bin/pg_config'
58+
# otherwise the latest installed version will be used.
59+
# Note that the relevant postgresql-devel package is required, not just postgresql
5460
run <<~SHELL
55-
cd #{release_path} && bundle config --local build.pg --with-pg-config=/usr/pgsql-11/bin/pg_config
61+
set -e;
62+
cd #{release_path};
63+
pg_conf_path="#{fetch(:pg_conf_path, '')}";
64+
if [ -z "$pg_conf_path" ]; then
65+
pg_conf_path=`ls -1d /usr/pgsql-{9*,[1-8]*}/include 2> /dev/null | sed -e 's:/include$:/bin/pg_config:' | tail -1`;
66+
fi;
67+
if [ -n "$pg_conf_path" ]; then
68+
echo Using pg_conf_path=\\"$pg_conf_path\\";
69+
bundle config --local build.pg --with-pg-config="$pg_conf_path";
70+
fi
5671
SHELL
5772
end
5873
end
-56 KB
Binary file not shown.
56.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)