Class: Dockman::Dockify::SkeletonGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Dockman::Dockify::SkeletonGenerator
- Defined in:
- lib/generators/dockman/dockify/skeleton/skeleton_generator.rb
Instance Method Summary collapse
- #copy_docker_related ⇒ Object
- #copy_infra ⇒ Object
- #copy_warehouse ⇒ Object
- #create_docker_volumes_and_networks ⇒ Object
- #ignore_responsibly ⇒ Object
Instance Method Details
#copy_docker_related ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/generators/dockman/dockify/skeleton/skeleton_generator.rb', line 19 def copy_file 'docker-compose.yml' copy_file 'docker-compose.dbs.yml' copy_file 'Dockerfile' copy_file 'docker-sync.yml' copy_file '.dockerignore' template 'envrc.erb', '.env.development' end |
#copy_infra ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/generators/dockman/dockify/skeleton/skeleton_generator.rb', line 11 def copy_infra directory 'infra' if File.exist?('config/database.yml') File.rename('config/database.yml',"config/database.#{Time.now.to_i}.yml") end copy_file 'config/database.yml' end |
#copy_warehouse ⇒ Object
7 8 9 |
# File 'lib/generators/dockman/dockify/skeleton/skeleton_generator.rb', line 7 def copy_warehouse directory 'warehouse' end |
#create_docker_volumes_and_networks ⇒ Object
37 38 39 40 41 |
# File 'lib/generators/dockman/dockify/skeleton/skeleton_generator.rb', line 37 def create_docker_volumes_and_networks system "docker volume create #{file_name}-web-sync" system "docker volume create #{file_name}-bundle-sync" system "docker network create #{file_name}-nginx-proxy" end |
#ignore_responsibly ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/generators/dockman/dockify/skeleton/skeleton_generator.rb', line 28 def ignore_responsibly append_to_file '.gitignore' do <<-IGN /warehouse/ /.docker-sync/ /.envrc IGN end end |