Skip to content

Commit 98c3bb4

Browse files
committed
Use ruby package's runtime.env generation func
- remove hard-coded GEM_HOME - move BUNDLE_GEMFILE out of BPM into start scripts
1 parent 35af51c commit 98c3bb4

8 files changed

Lines changed: 18 additions & 11 deletions

File tree

jobs/director/templates/env.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
source /var/vcap/packages/director-ruby-4.0/bosh/runtime.env
2+
source /var/vcap/packages/director/bosh/runtime.env
3+
24
export BUNDLE_GEMFILE=/var/vcap/packages/director/Gemfile
3-
export GEM_HOME=/var/vcap/packages/director/gem_home/ruby/4.0.6
45

56
<% if_p('env.http_proxy') do |http_proxy| %>
67
export HTTP_PROXY=<%= http_proxy %>

jobs/health_monitor/templates/bpm.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
health_monitor_config = {
33
"name" => "health_monitor",
44
"executable" => "/var/vcap/jobs/health_monitor/bin/health_monitor",
5-
"env" => {
6-
"BUNDLE_GEMFILE" => "/var/vcap/packages/health_monitor/Gemfile",
7-
},
5+
"env" => {},
86
"unsafe" => {
97
"unrestricted_volumes" => [
108
{
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22

33
source /var/vcap/packages/director-ruby-4.0/bosh/runtime.env
4-
export GEM_HOME=/var/vcap/packages/health_monitor/gem_home/ruby/4.0.6
5-
exec /var/vcap/packages/health_monitor/bin/bosh-monitor -c /var/vcap/jobs/health_monitor/config/health_monitor.yml
4+
source /var/vcap/packages/health_monitor/bosh/runtime.env
5+
6+
export BUNDLE_GEMFILE=/var/vcap/packages/health_monitor/Gemfile
7+
8+
exec /var/vcap/packages/health_monitor/bin/bosh-monitor \
9+
-c /var/vcap/jobs/health_monitor/config/health_monitor.yml

jobs/nats/templates/bosh_nats_sync

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22

33
source /var/vcap/packages/director-ruby-4.0/bosh/runtime.env
4-
export GEM_HOME=/var/vcap/packages/nats/gem_home/ruby/4.0.6
5-
exec /var/vcap/packages/nats/bin/bosh-nats-sync -c /var/vcap/jobs/nats/config/bosh_nats_sync_config.yml
4+
source /var/vcap/packages/nats/bosh/runtime.env
5+
6+
export BUNDLE_GEMFILE=/var/vcap/packages/nats/Gemfile
7+
8+
exec /var/vcap/packages/nats/bin/bosh-nats-sync \
9+
-c /var/vcap/jobs/nats/config/bosh_nats_sync_config.yml

jobs/nats/templates/bpm.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ bosh_nats_sync_config = {
44
"name" => "bosh_nats_sync",
55
"executable" => "/var/vcap/jobs/nats/bin/bosh_nats_sync",
66
"ephemeral_disk" => true,
7-
"env" => {
8-
"BUNDLE_GEMFILE" => "/var/vcap/packages/nats/Gemfile",
9-
},
107
"unsafe" => {
118
"privileged" => true,
129
"host_pid_namespace" => true,

packages/director/packaging

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ bundle config set build.pg \
3434
--with-pg-include=$libpq_dir/include
3535

3636
bosh_bundle_local
37+
bosh_generate_runtime_env
3738

3839
cp Gemfile ${BOSH_INSTALL_TARGET}
3940
cp Gemfile.lock ${BOSH_INSTALL_TARGET}

packages/health_monitor/packaging

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ for gemspec in $( find . -maxdepth 2 -name *.gemspec ); do
2121
done
2222

2323
bosh_bundle_local
24+
bosh_generate_runtime_env
2425

2526
cp Gemfile ${BOSH_INSTALL_TARGET}
2627
cp Gemfile.lock ${BOSH_INSTALL_TARGET}

packages/nats/packaging

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ for gemspec in $( find . -maxdepth 2 -name *.gemspec ); do
2828
done
2929

3030
bosh_bundle_local
31+
bosh_generate_runtime_env
3132

3233
cp Gemfile ${BOSH_INSTALL_TARGET}
3334
cp Gemfile.lock ${BOSH_INSTALL_TARGET}

0 commit comments

Comments
 (0)