Class: Jets::Core::Booter
- Inherits:
-
Object
- Object
- Jets::Core::Booter
- Extended by:
- Memoist
- Defined in:
- lib/jets/core/booter.rb
Class Attribute Summary collapse
-
.boot_at ⇒ Object
readonly
Returns the value of attribute boot_at.
-
.gid ⇒ Object
readonly
Returns the value of attribute gid.
Class Method Summary collapse
- .boot! ⇒ Object
- .initialize! ⇒ Object
-
.require_bootstrap? ⇒ Boolean
Essentially deployment commands require the bootstrap to be run.
- .require_config(name) ⇒ Object
Class Attribute Details
.boot_at ⇒ Object (readonly)
Returns the value of attribute boot_at.
8 9 10 |
# File 'lib/jets/core/booter.rb', line 8 def boot_at @boot_at end |
.gid ⇒ Object (readonly)
Returns the value of attribute gid.
8 9 10 |
# File 'lib/jets/core/booter.rb', line 8 def gid @gid end |
Class Method Details
.boot! ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/jets/core/booter.rb', line 9 def boot! return false if @boot_at Jets::Bundle.require # require all the gems in the Gemfile require_config(:project) # for config.dotenv.overwrite if require_bootstrap? Jets::Dotenv.load! require_config(:bootstrap) end initialize! @gid = SecureRandom.uuid[0..7] @boot_at = Time.now.utc end |
.initialize! ⇒ Object
26 27 28 29 30 |
# File 'lib/jets/core/booter.rb', line 26 def initialize! main = Jets::Autoloaders.main main.configure(Jets.root) main.setup end |
.require_bootstrap? ⇒ Boolean
Essentially deployment commands require the bootstrap to be run
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/jets/core/booter.rb', line 33 def require_bootstrap? args = ARGV.reject { |arg| arg.start_with?("-") } %w[ bootstrap build delete deploy dockerfile release:rollback ].include?(args.last) end |