From 237289e2fd730dc85a37a28d14dcb96a388ef980 Mon Sep 17 00:00:00 2001 From: jiikko Date: Mon, 8 Jan 2024 14:41:29 +0900 Subject: [PATCH 1/9] =?UTF-8?q?pbmenv=E3=81=8B=E3=82=89=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB=E3=81=97=E3=81=9F=E3=81=A8?= =?UTF-8?q?=E3=81=8D=E3=81=ABroot=E3=82=92=E4=BD=BF=E3=82=8F=E3=81=9A?= =?UTF-8?q?=E3=81=AB=E8=B5=B7=E5=8B=95=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project_template/.ruby-version | 1 + project_template/Gemfile | 7 +++++ project_template/app.rb | 56 ++++++++++++++++++---------------- project_template/exe/run | 25 +++++++++++++++ 4 files changed, 62 insertions(+), 27 deletions(-) create mode 100644 project_template/.ruby-version create mode 100644 project_template/Gemfile create mode 100755 project_template/exe/run diff --git a/project_template/.ruby-version b/project_template/.ruby-version new file mode 100644 index 000000000..cb2b00e4f --- /dev/null +++ b/project_template/.ruby-version @@ -0,0 +1 @@ +3.0.1 diff --git a/project_template/Gemfile b/project_template/Gemfile new file mode 100644 index 000000000..5a6eed978 --- /dev/null +++ b/project_template/Gemfile @@ -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.11' diff --git a/project_template/app.rb b/project_template/app.rb index 469cbcde5..3b95d1d6e 100644 --- a/project_template/app.rb +++ b/project_template/app.rb @@ -1,36 +1,38 @@ #!/usr/bin/env ruby -require 'bundler/inline' +if !ENV['RUN_WITH_BUNDLE_EXEC'] + require 'bundler/inline' -retry_count_on_git_command_error = 0 -begin - if retry_count_on_git_command_error > 10 - STDOUT.puts "Stopped the procon_bypass_man program because could not download any source codes." - exit 1 - end + retry_count_on_git_command_error = 0 + begin + if retry_count_on_git_command_error > 10 + STDOUT.puts "Stopped the procon_bypass_man program because could not download any source codes." + exit 1 + end - gemfile do - source 'https://rubygems.org' - git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } - gem 'procon_bypass_man', '0.3.11' - # uncomment if you want to use master branch - # gem 'procon_bypass_man', github: 'splaplapla/procon_bypass_man', branch: 'master' - # uncomment if you want to use serial communication feature - # gem "serialport" - end -rescue Bundler::Source::Git::GitCommandError => e - retry_count_on_git_command_error = retry_count_on_git_command_error + 1 - sleep(5) # サービスの起動順によっては、まだoffline状態なので待機する + gemfile do + source 'https://rubygems.org' + git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } + gem 'procon_bypass_man', '0.3.11' + # uncomment if you want to use master branch + # gem 'procon_bypass_man', github: 'splaplapla/procon_bypass_man', branch: 'master' + # uncomment if you want to use serial communication feature + # gem "serialport" + end + rescue Bundler::Source::Git::GitCommandError => e + retry_count_on_git_command_error = retry_count_on_git_command_error + 1 + sleep(5) # サービスの起動順によっては、まだoffline状態なので待機する - # install中に強制終了するとgitの管理ファイルが不正状態になり、次のエラーが起きるので発生したらcache directoryを削除する - #"Git error: command `git fetch --force --quiet --tags https://github.com/splaplapla/procon_bypass_man refs/heads/\\*:refs/heads/\\*` in directory /home/pi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/cache/bundler/git/procon_bypass_man-ae4c9016d76b667658c8ba66f3bbd2eebf2656af has failed.\n\nIf this error persists you could try removing the cache directory '/home/pi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/cache/bundler/git/procon_bypass_man-ae4c9016d76b667658c8ba66f3bbd2eebf2656af'" - if /try removing the cache directory '([^']+)'/ =~ e.message && $1&.start_with?('/home/pi/.rbenv') - require 'fileutils' - FileUtils.rm_rf($1) - STDOUT.puts "Deleted #{$1}" - end + # install中に強制終了するとgitの管理ファイルが不正状態になり、次のエラーが起きるので発生したらcache directoryを削除する + #"Git error: command `git fetch --force --quiet --tags https://github.com/splaplapla/procon_bypass_man refs/heads/\\*:refs/heads/\\*` in directory /home/pi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/cache/bundler/git/procon_bypass_man-ae4c9016d76b667658c8ba66f3bbd2eebf2656af has failed.\n\nIf this error persists you could try removing the cache directory '/home/pi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/cache/bundler/git/procon_bypass_man-ae4c9016d76b667658c8ba66f3bbd2eebf2656af'" + if /try removing the cache directory '([^']+)'/ =~ e.message && $1&.start_with?('/home/pi/.rbenv') + require 'fileutils' + FileUtils.rm_rf($1) + STDOUT.puts "Deleted #{$1}" + end - retry + retry + end end ProconBypassMan.configure do |config| diff --git a/project_template/exe/run b/project_template/exe/run new file mode 100755 index 000000000..a87213e87 --- /dev/null +++ b/project_template/exe/run @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' +set -vx + + +# 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 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 + +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 || bundle install +RUN_WITH_BUNDLE_EXEC=1 bundle exec app.rb From 58c310f39e8a91b6f92bfd06932b8f42dcf7d10e Mon Sep 17 00:00:00 2001 From: jiikko Date: Mon, 8 Jan 2024 14:45:16 +0900 Subject: [PATCH 2/9] =?UTF-8?q?fixup!=20pbmenv=E3=81=8B=E3=82=89=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB=E3=81=97=E3=81=9F?= =?UTF-8?q?=E3=81=A8=E3=81=8D=E3=81=ABroot=E3=82=92=E4=BD=BF=E3=82=8F?= =?UTF-8?q?=E3=81=9A=E3=81=AB=E8=B5=B7=E5=8B=95=E3=81=A7=E3=81=8D=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project_template/app.rb.erb | 56 +++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/project_template/app.rb.erb b/project_template/app.rb.erb index 3b46935bb..5fe98f6b6 100644 --- a/project_template/app.rb.erb +++ b/project_template/app.rb.erb @@ -1,36 +1,38 @@ #!/usr/bin/env ruby -require 'bundler/inline' +if !ENV['RUN_WITH_BUNDLE_EXEC'] + require 'bundler/inline' -retry_count_on_git_command_error = 0 -begin - if retry_count_on_git_command_error > 10 - STDOUT.puts "Stopped the procon_bypass_man program because could not download any source codes." - exit 1 - end + retry_count_on_git_command_error = 0 + begin + if retry_count_on_git_command_error > 10 + STDOUT.puts "Stopped the procon_bypass_man program because could not download any source codes." + exit 1 + end - gemfile do - source 'https://rubygems.org' - git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } - gem 'procon_bypass_man', '0.3.11' - # uncomment if you want to use master branch - # gem 'procon_bypass_man', github: 'splaplapla/procon_bypass_man', branch: 'master' - # uncomment if you want to use serial communication feature - # gem "serialport" - end -rescue Bundler::Source::Git::GitCommandError => e - retry_count_on_git_command_error = retry_count_on_git_command_error + 1 - sleep(5) # サービスの起動順によっては、まだoffline状態なので待機する + gemfile do + source 'https://rubygems.org' + git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } + gem 'procon_bypass_man', '0.3.11' + # uncomment if you want to use master branch + # gem 'procon_bypass_man', github: 'splaplapla/procon_bypass_man', branch: 'master' + # uncomment if you want to use serial communication feature + # gem "serialport" + end + rescue Bundler::Source::Git::GitCommandError => e + retry_count_on_git_command_error = retry_count_on_git_command_error + 1 + sleep(5) # サービスの起動順によっては、まだoffline状態なので待機する - # install中に強制終了するとgitの管理ファイルが不正状態になり、次のエラーが起きるので発生したらcache directoryを削除する - #"Git error: command `git fetch --force --quiet --tags https://github.com/splaplapla/procon_bypass_man refs/heads/\\*:refs/heads/\\*` in directory /home/pi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/cache/bundler/git/procon_bypass_man-ae4c9016d76b667658c8ba66f3bbd2eebf2656af has failed.\n\nIf this error persists you could try removing the cache directory '/home/pi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/cache/bundler/git/procon_bypass_man-ae4c9016d76b667658c8ba66f3bbd2eebf2656af'" - if /try removing the cache directory '([^']+)'/ =~ e.message && $1&.start_with?('/home/pi/.rbenv') - require 'fileutils' - FileUtils.rm_rf($1) - STDOUT.puts "Deleted #{$1}" - end + # install中に強制終了するとgitの管理ファイルが不正状態になり、次のエラーが起きるので発生したらcache directoryを削除する + #"Git error: command `git fetch --force --quiet --tags https://github.com/splaplapla/procon_bypass_man refs/heads/\\*:refs/heads/\\*` in directory /home/pi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/cache/bundler/git/procon_bypass_man-ae4c9016d76b667658c8ba66f3bbd2eebf2656af has failed.\n\nIf this error persists you could try removing the cache directory '/home/pi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/cache/bundler/git/procon_bypass_man-ae4c9016d76b667658c8ba66f3bbd2eebf2656af'" + if /try removing the cache directory '([^']+)'/ =~ e.message && $1&.start_with?('/home/pi/.rbenv') + require 'fileutils' + FileUtils.rm_rf($1) + STDOUT.puts "Deleted #{$1}" + end - retry + retry + end end ProconBypassMan.configure do |config| From cb0b9494a53b2fe4ec521d30a3dc65dba188500f Mon Sep 17 00:00:00 2001 From: jiikko Date: Mon, 8 Jan 2024 15:09:35 +0900 Subject: [PATCH 3/9] =?UTF-8?q?project=5Ftemplate/Gemfile=E3=82=92?= =?UTF-8?q?=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89=E3=81=8B=E3=82=89=E7=94=9F?= =?UTF-8?q?=E6=88=90=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 2 +- bin/build_project_template | 20 ++++++++++++++++++++ bin/generate_default_app | 10 ---------- project_template/Gemfile.erb | 7 +++++++ 4 files changed, 28 insertions(+), 11 deletions(-) create mode 100755 bin/build_project_template delete mode 100755 bin/generate_default_app create mode 100644 project_template/Gemfile.erb diff --git a/.circleci/config.yml b/.circleci/config.yml index fe6cb2e57..e97d9e37e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,7 +62,7 @@ jobs: tag: 3.0.1 steps: - checkout - - run: ruby bin/generate_default_app && git diff --exit-code project_template/app.rb + - run: ruby bin/build_project_template && git diff --exit-code project_template/app.rb project_template/Gemfile bundle_install: parameters: diff --git a/bin/build_project_template b/bin/build_project_template new file mode 100755 index 000000000..5718db466 --- /dev/null +++ b/bin/build_project_template @@ -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" diff --git a/bin/generate_default_app b/bin/generate_default_app deleted file mode 100755 index ba52737e4..000000000 --- a/bin/generate_default_app +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env ruby - -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" diff --git a/project_template/Gemfile.erb b/project_template/Gemfile.erb new file mode 100644 index 000000000..64524f116 --- /dev/null +++ b/project_template/Gemfile.erb @@ -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 %>' From 179f062f8205ec8964f72857756c203fdb3a11f8 Mon Sep 17 00:00:00 2001 From: jiikko Date: Sat, 20 Jan 2024 23:01:37 +0900 Subject: [PATCH 4/9] =?UTF-8?q?ruby=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89?= =?UTF-8?q?=E3=81=8C=E5=BF=85=E8=A6=81=E3=81=AA=E3=81=AE=E3=82=92=E6=8A=9C?= =?UTF-8?q?=E3=81=91=E3=81=A6=E3=81=84=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project_template/exe/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_template/exe/run b/project_template/exe/run index a87213e87..d7ecbbf2b 100755 --- a/project_template/exe/run +++ b/project_template/exe/run @@ -22,4 +22,4 @@ if find "/home/$EXECUINTG_USER/.rbenv/" -user root | read; then fi bundle check || bundle install -RUN_WITH_BUNDLE_EXEC=1 bundle exec app.rb +RUN_WITH_BUNDLE_EXEC=1 bundle exec ruby app.rb From 9034ba9d7f1770b5c180171b302cc9008d7c4f63 Mon Sep 17 00:00:00 2001 From: jiikko Date: Sat, 20 Jan 2024 23:01:46 +0900 Subject: [PATCH 5/9] =?UTF-8?q?require=E3=81=8C=E5=BF=85=E8=A6=81=E3=81=A0?= =?UTF-8?q?=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project_template/app.rb | 3 +++ project_template/app.rb.erb | 3 +++ 2 files changed, 6 insertions(+) diff --git a/project_template/app.rb b/project_template/app.rb index d026e0661..25356eccc 100644 --- a/project_template/app.rb +++ b/project_template/app.rb @@ -61,6 +61,9 @@ # ProconBypassMan::ExternalInput::Channels::SerialPortChannel.new(device_path: '/dev/serial0', baud_rate: 9600), # ProconBypassMan::ExternalInput::Channels::TCPIPChannel.new(port: 9000), # ] +else + require 'bundler' + Bundler.require(:default) end ProconBypassMan.run(setting_path: "/usr/share/pbm/current/setting.yml") diff --git a/project_template/app.rb.erb b/project_template/app.rb.erb index 2081cdd8d..214792229 100644 --- a/project_template/app.rb.erb +++ b/project_template/app.rb.erb @@ -66,6 +66,9 @@ ProconBypassMan.configure do |config| # ProconBypassMan::ExternalInput::Channels::SerialPortChannel.new(device_path: '/dev/serial0', baud_rate: 9600), # ProconBypassMan::ExternalInput::Channels::TCPIPChannel.new(port: 9000), # ] +else + require 'bundler' + Bundler.require(:default) end ProconBypassMan.run(setting_path: "/usr/share/pbm/current/setting.yml") From c9781ee02973a7b1cd0581e03f5b3a166f4e5bea Mon Sep 17 00:00:00 2001 From: jiikko Date: Sat, 20 Jan 2024 23:04:10 +0900 Subject: [PATCH 6/9] ooops --- project_template/app.rb | 6 +++--- project_template/app.rb.erb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/project_template/app.rb b/project_template/app.rb index 25356eccc..b991a16c8 100644 --- a/project_template/app.rb +++ b/project_template/app.rb @@ -33,6 +33,9 @@ retry end +else + require 'bundler' + Bundler.require(:default) end ProconBypassMan.configure do |config| @@ -61,9 +64,6 @@ # ProconBypassMan::ExternalInput::Channels::SerialPortChannel.new(device_path: '/dev/serial0', baud_rate: 9600), # ProconBypassMan::ExternalInput::Channels::TCPIPChannel.new(port: 9000), # ] -else - require 'bundler' - Bundler.require(:default) end ProconBypassMan.run(setting_path: "/usr/share/pbm/current/setting.yml") diff --git a/project_template/app.rb.erb b/project_template/app.rb.erb index 214792229..b93568836 100644 --- a/project_template/app.rb.erb +++ b/project_template/app.rb.erb @@ -33,6 +33,9 @@ if !ENV['RUN_WITH_BUNDLE_EXEC'] retry end +else + require 'bundler' + Bundler.require(:default) end ProconBypassMan.configure do |config| @@ -66,9 +69,6 @@ ProconBypassMan.configure do |config| # ProconBypassMan::ExternalInput::Channels::SerialPortChannel.new(device_path: '/dev/serial0', baud_rate: 9600), # ProconBypassMan::ExternalInput::Channels::TCPIPChannel.new(port: 9000), # ] -else - require 'bundler' - Bundler.require(:default) end ProconBypassMan.run(setting_path: "/usr/share/pbm/current/setting.yml") From 7c8ee72ff88c5be6909c88fc2890f779c1b89b9c Mon Sep 17 00:00:00 2001 From: jiikko Date: Sun, 21 Jan 2024 00:15:35 +0900 Subject: [PATCH 7/9] =?UTF-8?q?=E6=A8=99=E6=BA=96=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E3=81=8C=E6=B1=9A=E3=82=8C=E3=82=8B=E3=81=AE=E3=81=A7=E3=82=AA?= =?UTF-8?q?=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E6=B6=88=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project_template/exe/run | 2 -- 1 file changed, 2 deletions(-) diff --git a/project_template/exe/run b/project_template/exe/run index d7ecbbf2b..74ea5b6f1 100755 --- a/project_template/exe/run +++ b/project_template/exe/run @@ -1,8 +1,6 @@ #!/usr/bin/env bash set -euo pipefail IFS=$'\n\t' -set -vx - # rootで起動していた影響で一般ユーザで起動するには権限を修正しないといけない EXECUINTG_USER="$(whoami)" From 404874729dc27f1ee8b314d263946d3ab3854365 Mon Sep 17 00:00:00 2001 From: jiikko Date: Sun, 21 Jan 2024 11:37:56 +0900 Subject: [PATCH 8/9] =?UTF-8?q?=E5=AD=98=E5=9C=A8=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=AA=E3=82=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project_template/exe/run | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/project_template/exe/run b/project_template/exe/run index 74ea5b6f1..fc9a54718 100755 --- a/project_template/exe/run +++ b/project_template/exe/run @@ -9,9 +9,11 @@ if find /usr/share/pbm/ -user root | read; then echo "We have recovered /usr/share/pbm/* permissions" fi -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" +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 From f219da6acffe99f74338cca3e9496045076335ed Mon Sep 17 00:00:00 2001 From: jiikko Date: Sun, 21 Jan 2024 19:47:23 +0900 Subject: [PATCH 9/9] =?UTF-8?q?bundle=20check=E3=82=92=E3=82=AF=E3=83=AA?= =?UTF-8?q?=E3=82=A2=E3=81=97=E3=81=9F=E6=99=82=E3=81=AE=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E3=82=92=E6=B6=88=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project_template/exe/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_template/exe/run b/project_template/exe/run index fc9a54718..d927444b9 100755 --- a/project_template/exe/run +++ b/project_template/exe/run @@ -21,5 +21,5 @@ if find "/home/$EXECUINTG_USER/.rbenv/" -user root | read; then echo "We have recovered /home/$EXECUINTG_USER/.rbenv/" fi -bundle check || bundle install +bundle check > /dev/null || bundle install RUN_WITH_BUNDLE_EXEC=1 bundle exec ruby app.rb