Class: Jets::CLI::Tip
- Inherits:
-
Object
- Object
- Jets::CLI::Tip
- Defined in:
- lib/jets/cli/tip.rb
Class Method Summary collapse
Instance Method Summary collapse
- #already_configured? ⇒ Boolean
- #concurrency_change ⇒ Object
- #disable_howto ⇒ Object
- #enabled? ⇒ Boolean
- #env_change ⇒ Object
- #faster_deploy ⇒ Object
-
#initialize(name) ⇒ Tip
constructor
A new instance of Tip.
- #remote_run ⇒ Object
- #show(options = {}) ⇒ Object
- #ssm_change ⇒ Object
Constructor Details
#initialize(name) ⇒ Tip
Returns a new instance of Tip.
11 12 13 |
# File 'lib/jets/cli/tip.rb', line 11 def initialize(name) @name = name end |
Class Method Details
.show(name, options = {}) ⇒ Object
4 5 6 |
# File 'lib/jets/cli/tip.rb', line 4 def show(name, = {}) new(name).show() end |
Instance Method Details
#already_configured? ⇒ Boolean
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/jets/cli/tip.rb', line 22 def already_configured? if @name == :faster_deploy config = Jets.bootstrap.config config.codebuild.project.env.vars.key?(:DOCKER_HOST) || config.codebuild.fleet.enable || config.codebuild.fleet_override else false end end |
#concurrency_change ⇒ Object
44 45 46 47 48 49 |
# File 'lib/jets/cli/tip.rb', line 44 def concurrency_change <<~EOL Note: CLI changes to concurrency are outside of deployment EOL end |
#disable_howto ⇒ Object
66 67 68 69 70 71 72 73 |
# File 'lib/jets/cli/tip.rb', line 66 def disable_howto <<~EOL To disable this tip: * set config.tips.#{@name} = false in config/jets/project.rb * See: https://docs.rubyonjets.com/docs/more/cli-tips/ EOL end |
#enabled? ⇒ Boolean
82 83 84 |
# File 'lib/jets/cli/tip.rb', line 82 def enabled? config.tips.enable && config.tips[@name] end |
#env_change ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/jets/cli/tip.rb', line 51 def env_change <<~EOL Note: CLI changes to env vars are outside of deployment See: https://docs.rubyonjets.com/env/cli/ EOL end |
#faster_deploy ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/jets/cli/tip.rb', line 33 def faster_deploy <<~EOL Tip: You can speed the deploy with one of these options: * Docker Remote Host: https://docs.rubyonjets.com/docs/remote/codebuild/docker/ * CodeBuild Fleet: https://docs.rubyonjets.com/docs/remote/codebuild/fleet/ Enabling of those options will also remove this message. EOL end |
#remote_run ⇒ Object
75 76 77 78 79 80 |
# File 'lib/jets/cli/tip.rb', line 75 def remote_run <<~EOL Ctrl-C will stop showing logs. Jets will continue to run remotely. If you want to stop the remote process, use: jets stop EOL end |
#show(options = {}) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/jets/cli/tip.rb', line 15 def show( = {}) return if already_configured? return unless enabled? puts send(@name) puts disable_howto unless [:disable_howto] == false end |
#ssm_change ⇒ Object
59 60 61 62 63 64 |
# File 'lib/jets/cli/tip.rb', line 59 def ssm_change <<~EOL After deleting a parameter, wait for at least 30 seconds to create a parameter with the same name EOL end |