-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #290 from splaplapla/support-bundle-exec
pbmenvからインストールしたときにrootを使わずに起動できるようにする
- Loading branch information
Showing
9 changed files
with
125 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env ruby | ||
|
||
# build app.rb | ||
require "./project_template/lib/app_generator" | ||
AppGenerator.new( | ||
prefix_path: "./project_template", | ||
enable_integration_with_pbm_cloud: false, | ||
).generate | ||
|
||
puts "Created project_template/app.rb" | ||
|
||
|
||
# build Gemfile | ||
require "erb" | ||
match = (/=\s+?"([\d\.]*)"/).match(File.read('./lib/procon_bypass_man/version.rb')) | ||
body_erb = File.read('project_template/Gemfile.erb') | ||
pbm_version = pbm_version = match[1] | ||
body = ERB.new(body_erb, trim_mode: '-').result(binding) | ||
File.write('project_template/Gemfile', body) | ||
puts "Created project_template/Gemfile" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
|
||
# if you want to use the latest version, please use the following line. | ||
# gem 'procon_bypass_man', github: 'splaplapla/procon_bypass_man', branch: "master" | ||
gem 'procon_bypass_man', '0.3.12' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
|
||
# if you want to use the latest version, please use the following line. | ||
# gem 'procon_bypass_man', github: 'splaplapla/procon_bypass_man', branch: "master" | ||
gem 'procon_bypass_man', '<%= pbm_version %>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
# rootで起動していた影響で一般ユーザで起動するには権限を修正しないといけない | ||
EXECUINTG_USER="$(whoami)" | ||
if find /usr/share/pbm/ -user root | read; then | ||
sudo chown "$EXECUINTG_USER:$EXECUINTG_USER" -R /usr/share/pbm | ||
echo "We have recovered /usr/share/pbm/* permissions" | ||
fi | ||
|
||
if [ -e /tmp/pbm_blue_green_process_pids ]; then | ||
if find /tmp/pbm_blue_green_process_pids -user root | read; then | ||
sudo chown "$EXECUINTG_USER:$EXECUINTG_USER" /tmp/pbm_blue_green_process_pids | ||
echo "We have recovered /tmp/pbm_blue_green_process_pids permissions" | ||
fi | ||
fi | ||
|
||
if find "/home/$EXECUINTG_USER/.rbenv/" -user root | read; then | ||
sudo chown "$EXECUINTG_USER:$EXECUINTG_USER" "/home/$EXECUINTG_USER/.rbenv/" | ||
echo "We have recovered /home/$EXECUINTG_USER/.rbenv/" | ||
fi | ||
|
||
bundle check > /dev/null || bundle install | ||
RUN_WITH_BUNDLE_EXEC=1 bundle exec ruby app.rb |