Class: Locomotive::Wagon::PushCommand
- Inherits:
-
Struct
- Object
- Struct
- Locomotive::Wagon::PushCommand
- Includes:
- ApiConcern, DeployFileConcern, InstrumentationConcern, NetrcConcern, SpinnerConcern, SteamConcern
- Defined in:
- lib/locomotive/wagon/commands/push_command.rb
Constant Summary collapse
- RESOURCES =
%w(site content_types content_entries pages snippets sections theme_assets translations).freeze
- RESOURCES_WITH_CONTENT =
%w(content_entries translations).freeze
Instance Attribute Summary collapse
-
#credentials ⇒ Object
Returns the value of attribute credentials.
-
#env ⇒ Object
Returns the value of attribute env.
-
#options ⇒ Object
Returns the value of attribute options.
-
#path ⇒ Object
Returns the value of attribute path.
-
#platform_url ⇒ Object
Returns the value of attribute platform_url.
-
#shell ⇒ Object
Returns the value of attribute shell.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from SpinnerConcern
Methods included from InstrumentationConcern
#instrument, #instrument_scope_name
Methods included from SteamConcern
Methods included from DeployFileConcern
#deploy_file, #read_deploy_settings, #write_deploy_settings
Methods included from NetrcConcern
#read_credentials_from_netrc, #write_credentials_to_netrc
Methods included from ApiConcern
#api_client, #api_credentials, #api_host, #api_site_client, #connection_information_from_env_and_path
Instance Attribute Details
#credentials ⇒ Object
Returns the value of attribute credentials.
28 29 30 |
# File 'lib/locomotive/wagon/commands/push_command.rb', line 28 def credentials @credentials end |
#env ⇒ Object
Returns the value of attribute env
15 16 17 |
# File 'lib/locomotive/wagon/commands/push_command.rb', line 15 def env @env end |
#options ⇒ Object
Returns the value of attribute options
15 16 17 |
# File 'lib/locomotive/wagon/commands/push_command.rb', line 15 def @options end |
#path ⇒ Object
Returns the value of attribute path
15 16 17 |
# File 'lib/locomotive/wagon/commands/push_command.rb', line 15 def path @path end |
#platform_url ⇒ Object
Returns the value of attribute platform_url.
28 29 30 |
# File 'lib/locomotive/wagon/commands/push_command.rb', line 28 def platform_url @platform_url end |
#shell ⇒ Object
Returns the value of attribute shell
15 16 17 |
# File 'lib/locomotive/wagon/commands/push_command.rb', line 15 def shell @shell end |
Class Method Details
.push(env, path, options, shell) ⇒ Object
30 31 32 |
# File 'lib/locomotive/wagon/commands/push_command.rb', line 30 def self.push(env, path, , shell) self.new(env, path, , shell).push end |
Instance Method Details
#push ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/locomotive/wagon/commands/push_command.rb', line 34 def push require 'haml' Locomotive::Wagon.require_misc_gems api_client = build_api_site_client(connection_information) return if api_client.nil? # Ask for a confirmation (Warning) if we deploy with the -d option # since it alters content on the remote engine if [:data] return unless ask_for_performing("Warning! You're about to deploy data which will alter the content of your site.") end if [:verbose] PushLogger.new _push(api_client) else show_wait_spinner('Deploying...') { _push(api_client) } end end |