annotate bin/setup @ 254:89f6c0016bab default tip

Update to latest rails
author nanaya <me@nanaya.net>
date Tue, 03 Sep 2024 19:21:25 +0900
parents ad6264cca788
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
42
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
1 #!/usr/bin/env ruby
214
2335107f35d0 Run rails update
nanaya <me@nanaya.pro>
parents: 185
diff changeset
2 require "fileutils"
42
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
3
223
ad6264cca788 Update to rails 7
nanaya <me@nanaya.pro>
parents: 214
diff changeset
4 APP_ROOT = File.expand_path("..", __dir__)
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
5 APP_NAME = "rsstweet"
42
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
6
72
257910c60eb3 Rails 5 \o/
nanaya <me@myconan.net>
parents: 44
diff changeset
7 def system!(*args)
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
8 system(*args, exception: true)
72
257910c60eb3 Rails 5 \o/
nanaya <me@myconan.net>
parents: 44
diff changeset
9 end
257910c60eb3 Rails 5 \o/
nanaya <me@myconan.net>
parents: 44
diff changeset
10
185
f67f3ad50270 Update to latest rails and gems
nanaya <me@nanaya.pro>
parents: 72
diff changeset
11 FileUtils.chdir APP_ROOT do
214
2335107f35d0 Run rails update
nanaya <me@nanaya.pro>
parents: 185
diff changeset
12 # This script is a way to set up or update your development environment automatically.
2335107f35d0 Run rails update
nanaya <me@nanaya.pro>
parents: 185
diff changeset
13 # This script is idempotent, so that you can run it at any time and get an expectable outcome.
72
257910c60eb3 Rails 5 \o/
nanaya <me@myconan.net>
parents: 44
diff changeset
14 # Add necessary setup steps to this file.
42
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
15
223
ad6264cca788 Update to rails 7
nanaya <me@nanaya.pro>
parents: 214
diff changeset
16 puts "== Installing dependencies =="
ad6264cca788 Update to rails 7
nanaya <me@nanaya.pro>
parents: 214
diff changeset
17 system! "gem install bundler --conservative"
ad6264cca788 Update to rails 7
nanaya <me@nanaya.pro>
parents: 214
diff changeset
18 system("bundle check") || system!("bundle install")
42
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
19
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
20 puts "\n== Removing old logs and tempfiles =="
223
ad6264cca788 Update to rails 7
nanaya <me@nanaya.pro>
parents: 214
diff changeset
21 system! "bin/rails log:clear tmp:clear"
42
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
22
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
23 puts "\n== Restarting application server =="
223
ad6264cca788 Update to rails 7
nanaya <me@nanaya.pro>
parents: 214
diff changeset
24 system! "bin/rails restart"
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
25
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
26 # puts "\n== Configuring puma-dev =="
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
27 # system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 223
diff changeset
28 # system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
42
97a6973e9d94 Reset default scripts.
edogawaconan <me@myconan.net>
parents:
diff changeset
29 end