Class: Jack::Deploy
Instance Method Summary collapse
- #deploy ⇒ Object
- #environment_exists? ⇒ Boolean
-
#initialize(options = {}) ⇒ Deploy
constructor
A new instance of Deploy.
- #run ⇒ Object
Methods included from Util
#app_name_convention, #aws_bin, #check_aws_setup, #confirm, #eb, #eb_base_flags, #eb_bin, #ensure_folder_exist, #get_answer, #get_region, #prerequisites, #settings, #sh
Constructor Details
#initialize(options = {}) ⇒ Deploy
Returns a new instance of Deploy.
5 6 7 8 9 10 |
# File 'lib/jack/deploy.rb', line 5 def initialize(={}) @options = @root = [:root] || '.' @env_name = [:env_name] @app_name = [:app] || app_name_convention(@env_name) end |
Instance Method Details
#deploy ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/jack/deploy.rb', line 28 def deploy # EB_OPTIONS are passed through to the underlying eb deploy command # # optional arguments: # -h, --help show this help message and exit # --debug toggle debug output # --quiet suppress all output # -v, --verbose toggle verbose output # --profile PROFILE use a specific profile from your credential file # -r REGION, --region REGION # use a specific region # --no-verify-ssl do not verify AWS SSL certificates # --modules [MODULES [MODULES ...]] # modules to deploy # -g ENV_GROUP_SUFFIX, --env-group-suffix ENV_GROUP_SUFFIX # group suffix # --version VERSION existing version label to deploy # -l LABEL, --label LABEL # label name which version will be given # -m MESSAGE, --message MESSAGE # description for version # -nh, --nohang return immediately, do not wait for deploy to be # completed # --staged deploy files staged in git rather than the HEAD commit # --timeout TIMEOUT timeout period in minutes # --source SOURCE source of code to deploy directly; example # source_location/repo/branch # -p, --process enable preprocessing of the application version command = "#{eb_bin} deploy#{eb_base_flags} #{@env_name} #{ENV['EB_OPTIONS']}" sh(command) end |
#environment_exists? ⇒ Boolean
22 23 24 25 26 |
# File 'lib/jack/deploy.rb', line 22 def environment_exists? return true if @options[:noop] r = eb.describe_environments(application_name: @app_name) r.environments.collect(&:environment_name).include?(@env_name) end |