superhosting 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +11 -0
  5. data/Gemfile +5 -0
  6. data/Gemfile.lock +117 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +23 -0
  9. data/Rakefile +6 -0
  10. data/Vagrantfile +10 -0
  11. data/bin/sx +10 -0
  12. data/bootstrap.sh +31 -0
  13. data/lib/superhosting.rb +40 -0
  14. data/lib/superhosting/base.rb +37 -0
  15. data/lib/superhosting/cli/base.rb +227 -0
  16. data/lib/superhosting/cli/cmd/admin_add.rb +11 -0
  17. data/lib/superhosting/cli/cmd/admin_container_add.rb +16 -0
  18. data/lib/superhosting/cli/cmd/admin_container_delete.rb +16 -0
  19. data/lib/superhosting/cli/cmd/admin_container_list.rb +12 -0
  20. data/lib/superhosting/cli/cmd/admin_delete.rb +11 -0
  21. data/lib/superhosting/cli/cmd/admin_passwd.rb +16 -0
  22. data/lib/superhosting/cli/cmd/container_add.rb +21 -0
  23. data/lib/superhosting/cli/cmd/container_admin_add.rb +16 -0
  24. data/lib/superhosting/cli/cmd/container_admin_delete.rb +16 -0
  25. data/lib/superhosting/cli/cmd/container_admin_list.rb +12 -0
  26. data/lib/superhosting/cli/cmd/container_change.rb +21 -0
  27. data/lib/superhosting/cli/cmd/container_delete.rb +11 -0
  28. data/lib/superhosting/cli/cmd/container_list.rb +9 -0
  29. data/lib/superhosting/cli/cmd/container_reconfig.rb +11 -0
  30. data/lib/superhosting/cli/cmd/container_restore.rb +24 -0
  31. data/lib/superhosting/cli/cmd/container_save.rb +14 -0
  32. data/lib/superhosting/cli/cmd/container_update.rb +11 -0
  33. data/lib/superhosting/cli/cmd/mysql_db_add.rb +9 -0
  34. data/lib/superhosting/cli/cmd/mysql_db_delete.rb +9 -0
  35. data/lib/superhosting/cli/cmd/mysql_db_dump.rb +9 -0
  36. data/lib/superhosting/cli/cmd/mysql_db_sql.rb +9 -0
  37. data/lib/superhosting/cli/cmd/mysql_grant.rb +9 -0
  38. data/lib/superhosting/cli/cmd/mysql_user_add.rb +12 -0
  39. data/lib/superhosting/cli/cmd/mysql_user_delete.rb +9 -0
  40. data/lib/superhosting/cli/cmd/site_add.rb +16 -0
  41. data/lib/superhosting/cli/cmd/site_alias_add.rb +16 -0
  42. data/lib/superhosting/cli/cmd/site_alias_delete.rb +16 -0
  43. data/lib/superhosting/cli/cmd/site_delete.rb +11 -0
  44. data/lib/superhosting/cli/cmd/site_rename.rb +16 -0
  45. data/lib/superhosting/cli/cmd/user_add.rb +24 -0
  46. data/lib/superhosting/cli/cmd/user_change.rb +24 -0
  47. data/lib/superhosting/cli/cmd/user_delete.rb +16 -0
  48. data/lib/superhosting/cli/cmd/user_list.rb +9 -0
  49. data/lib/superhosting/cli/cmd/user_passwd.rb +16 -0
  50. data/lib/superhosting/cli/error/ambiguous_command.rb +11 -0
  51. data/lib/superhosting/cli/error/base.rb +8 -0
  52. data/lib/superhosting/cli/error/controller.rb +8 -0
  53. data/lib/superhosting/controller/admin.rb +21 -0
  54. data/lib/superhosting/controller/admin/container.rb +24 -0
  55. data/lib/superhosting/controller/container.rb +174 -0
  56. data/lib/superhosting/controller/container/admin.rb +24 -0
  57. data/lib/superhosting/controller/mysql.rb +17 -0
  58. data/lib/superhosting/controller/mysql/db.rb +23 -0
  59. data/lib/superhosting/controller/mysql/user.rb +15 -0
  60. data/lib/superhosting/controller/site.rb +106 -0
  61. data/lib/superhosting/controller/site/alias.rb +21 -0
  62. data/lib/superhosting/controller/user.rb +25 -0
  63. data/lib/superhosting/docker_api.rb +31 -0
  64. data/lib/superhosting/helpers.rb +30 -0
  65. data/lib/superhosting/script_executor/base.rb +26 -0
  66. data/lib/superhosting/script_executor/container.rb +36 -0
  67. data/lib/superhosting/script_executor/site.rb +13 -0
  68. data/lib/superhosting/version.rb +3 -0
  69. data/superhosting.gemspec +32 -0
  70. metadata +341 -0
@@ -0,0 +1,11 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class AdminAdd < Base
5
+ def self.has_required_param?
6
+ true
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,16 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class AdminContainerAdd < Base
5
+ option :admin_name,
6
+ :short => '-a NAME',
7
+ :long => '--admin NAME',
8
+ :required => true
9
+
10
+ def self.has_required_param?
11
+ true
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class AdminContainerDelete < Base
5
+ option :admin_name,
6
+ :short => '-a NAME',
7
+ :long => '--admin NAME',
8
+ :required => true
9
+
10
+ def self.has_required_param?
11
+ true
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class AdminContainerList < Base
5
+ option :admin_name,
6
+ :short => '-a NAME',
7
+ :long => '--admin NAME',
8
+ :required => true
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class AdminDelete < Base
5
+ def self.has_required_param?
6
+ true
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,16 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class AdminPasswd < Base
5
+ option :generate,
6
+ :short => '-g',
7
+ :long => '--generate',
8
+ :boolean => true
9
+
10
+ def self.has_required_param?
11
+ true
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class ContainerAdd < Base
5
+ option :model,
6
+ :short => '-m MODEL',
7
+ :long => '--model MODEL'
8
+
9
+ option :mail,
10
+ :long => '--mail MAIL'
11
+
12
+ option :admin_mail,
13
+ :long => '--admin-mail MAIL'
14
+
15
+ def self.has_required_param?
16
+ true
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,16 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class ContainerAdminAdd < Base
5
+ option :container_name,
6
+ :short => '-c NAME',
7
+ :long => '--container NAME',
8
+ :required => true
9
+
10
+ def self.has_required_param?
11
+ true
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class ContainerAdminDelete < Base
5
+ option :container_name,
6
+ :short => '-c NAME',
7
+ :long => '--container NAME',
8
+ :required => true
9
+
10
+ def self.has_required_param?
11
+ true
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class ContainerAdminList < Base
5
+ option :container_name,
6
+ :short => '-c NAME',
7
+ :long => '--container NAME',
8
+ :required => true
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,21 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class ContainerChange < Base
5
+ option :model,
6
+ :short => '-m',
7
+ :long => '--model'
8
+
9
+ option :mail,
10
+ :long => '--mail MAIL'
11
+
12
+ option :admin_mail,
13
+ :long => '--admin-mail MAIL'
14
+
15
+ def self.has_required_param?
16
+ true
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,11 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class ContainerDelete < Base
5
+ def self.has_required_param?
6
+ true
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class ContainerList < Base
5
+
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class ContainerReconfig < Base
5
+ def self.has_required_param?
6
+ true
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,24 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class ContainerRestore < Base
5
+ option :restore_from,
6
+ :long => '--from'
7
+
8
+ option :model,
9
+ :short => '-m',
10
+ :long => '--model'
11
+
12
+ option :mail,
13
+ :long => '--mail MAIL'
14
+
15
+ option :admin_mail,
16
+ :long => '--admin-mail MAIL'
17
+
18
+ def self.has_required_param?
19
+ true
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,14 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class ContainerSave < Base
5
+ option :save_to,
6
+ :long => '--to'
7
+
8
+ def self.has_required_param?
9
+ true
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,11 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class ContainerUpdate < Base
5
+ def self.has_required_param?
6
+ true
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class MysqlDbAdd < Base
5
+
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class MysqlDbDelete < Base
5
+
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class MysqlDbDump < Base
5
+
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class MysqlDbSql < Base
5
+
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class MysqlGrant < Base
5
+
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class MysqlUserAdd < Base
5
+ option :generate,
6
+ :short => '-g',
7
+ :long => '--generate',
8
+ :boolean => true
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class MysqlUserDelete < Base
5
+
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class SiteAdd < Base
5
+ option :container_name,
6
+ :short => '-c NAME',
7
+ :long => '--container NAME',
8
+ :required => true
9
+
10
+ def self.has_required_param?
11
+ true
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class SiteAliasAdd < Base
5
+ option :site_name,
6
+ :short => '-s NAME',
7
+ :long => '--site NAME',
8
+ :required => true
9
+
10
+ def self.has_required_param?
11
+ true
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class SiteAliasDelete < Base
5
+ option :site_name,
6
+ :short => '-s NAME',
7
+ :long => '--site NAME',
8
+ :required => true
9
+
10
+ def self.has_required_param?
11
+ true
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,11 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class SiteDelete < Base
5
+ def self.has_required_param?
6
+ true
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,16 @@
1
+ module Superhosting
2
+ module Cli
3
+ module Cmd
4
+ class SiteRename < Base
5
+ option :new_name,
6
+ :short => '-r NAME',
7
+ :long => '--new-name NAME',
8
+ :required => true
9
+
10
+ def self.has_required_param?
11
+ true
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end