Class: Ufo::Init
Class Method Summary collapse
-
.cli_options ⇒ Object
Ugly, this is how I can get the options from to match with this Thor::Group.
Instance Method Summary collapse
- #init_files ⇒ Object
-
#set_destination_root ⇒ Object
for specs.
- #upsert_gitignore ⇒ Object
- #user_message ⇒ Object
Methods inherited from Sequence
Class Method Details
.cli_options ⇒ Object
Ugly, this is how I can get the options from to match with this Thor::Group
7 8 9 10 11 12 13 |
# File 'lib/ufo/init.rb', line 7 def self. [ [:force, type: :boolean, desc: "Bypass overwrite are you sure prompt for existing files."], [:image, type: :string, required: true, desc: "Docker image name without the tag. Example: tongueroo/hi. Configures ufo/settings.yml"], [:app, type: :string, required: true, desc: "App name. Preferably one word. Used in the generated ufo/task_definitions.rb."], ] end |
Instance Method Details
#init_files ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/ufo/init.rb', line 28 def init_files # map variables @app = [:app] @image = [:image] # copy the files puts "Setting up ufo project..." directory "." end |
#set_destination_root ⇒ Object
for specs
19 20 21 22 23 24 25 26 |
# File 'lib/ufo/init.rb', line 19 def set_destination_root return unless ENV['UFO_ROOT'] dest = ENV['UFO_ROOT'] FileUtils.rm_rf(dest) && FileUtils.mkdir_p(dest) self.destination_root = dest FileUtils.cd(dest) end |
#upsert_gitignore ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/ufo/init.rb', line 37 def upsert_gitignore return unless File.exist?(".gitignore") append_to_file ".gitignore", <<-EOL .ufo/output .ufo/data EOL end |
#user_message ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/ufo/init.rb', line 45 def puts "Starter ufo files created." puts <<-EOL #{"="*64} Congrats 🎉 You have successfully set up ufo for your project. To deploy to ECS: ufo ship #{@app}-web If you need to customize the ECS task definition to configure things like memory and cpu allocation. You can do this by adjusting the files the .ufo/variables folder. These variables get applied to the .ufo/templates/main.json.erb task definition json that is passed to the ECS register task definition api. Some additional starter example roles for your apps were set up in in .ufo/task_definitions.rb. Be sure to check it out and adjust it for your needs. This allows you to fully customize and control your environment to fit your application's needs. More info: http://ufoships.com EOL end |