smartcloud 0.0.210 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -3
  3. data/bin/buildpacker +2 -2
  4. data/bin/prereceiver +8 -0
  5. data/bin/smartcloud +68 -62
  6. data/lib/smartcloud.rb +7 -0
  7. data/lib/smartcloud/apps/app.rb +182 -0
  8. data/lib/smartcloud/apps/rails.rb +240 -0
  9. data/lib/smartcloud/base.rb +1 -0
  10. data/lib/smartcloud/boot.rb +11 -80
  11. data/lib/smartcloud/buildpacker.rb +75 -0
  12. data/lib/smartcloud/credentials.rb +127 -0
  13. data/lib/smartcloud/docker.rb +41 -25
  14. data/lib/smartcloud/engine.rb +39 -30
  15. data/lib/smartcloud/engine/Dockerfile +18 -18
  16. data/lib/smartcloud/{grids/grid-runner → engine}/buildpacks/rails/Dockerfile +3 -14
  17. data/lib/smartcloud/grids/{grid-buildpacker → grid-nginx}/.keep +0 -0
  18. data/lib/smartcloud/grids/{grid-runner → grid-prereceiver}/Dockerfile +1 -18
  19. data/lib/smartcloud/grids/{grid-runner → grid-prereceiver}/fcgiwrap/APKBUILD +0 -0
  20. data/lib/smartcloud/grids/{grid-runner → grid-prereceiver}/fcgiwrap/fcgiwrap.confd +0 -0
  21. data/lib/smartcloud/grids/{grid-runner → grid-prereceiver}/fcgiwrap/fcgiwrap.initd +0 -0
  22. data/lib/smartcloud/grids/{grid-runner → grid-prereceiver}/fcgiwrap/fcgiwrap.pre-install +0 -0
  23. data/lib/smartcloud/grids/{grid-runner → grid-prereceiver}/fcgiwrap/packages/main/x86_64/APKINDEX.tar.gz +0 -0
  24. data/lib/smartcloud/grids/{grid-runner → grid-prereceiver}/fcgiwrap/packages/main/x86_64/fcgiwrap-1.1.1-r4.apk +0 -0
  25. data/lib/smartcloud/grids/{grid-runner → grid-prereceiver}/fcgiwrap/packages/main/x86_64/fcgiwrap-doc-1.1.1-r4.apk +0 -0
  26. data/lib/smartcloud/grids/{grid-runner → grid-prereceiver}/fcgiwrap/packages/main/x86_64/fcgiwrap-openrc-1.1.1-r4.apk +0 -0
  27. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-buildpacker → grids/grid-redmine}/.keep +0 -0
  28. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-runner/apps/containers → grids/grid-solr/config}/.keep +0 -0
  29. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/README.txt +0 -0
  30. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/contractions_ca.txt +0 -0
  31. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/contractions_fr.txt +0 -0
  32. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/contractions_ga.txt +0 -0
  33. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/contractions_it.txt +0 -0
  34. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/hyphenations_ga.txt +0 -0
  35. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stemdict_nl.txt +0 -0
  36. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stoptags_ja.txt +0 -0
  37. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_ar.txt +0 -0
  38. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_bg.txt +0 -0
  39. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_ca.txt +0 -0
  40. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_cz.txt +0 -0
  41. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_da.txt +0 -0
  42. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_de.txt +0 -0
  43. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_el.txt +0 -0
  44. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_en.txt +0 -0
  45. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_es.txt +0 -0
  46. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_eu.txt +0 -0
  47. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_fa.txt +0 -0
  48. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_fi.txt +0 -0
  49. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_fr.txt +0 -0
  50. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_ga.txt +0 -0
  51. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_gl.txt +0 -0
  52. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_hi.txt +0 -0
  53. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_hu.txt +0 -0
  54. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_hy.txt +0 -0
  55. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_id.txt +0 -0
  56. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_it.txt +0 -0
  57. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_ja.txt +0 -0
  58. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_lv.txt +0 -0
  59. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_nl.txt +0 -0
  60. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_no.txt +0 -0
  61. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_pt.txt +0 -0
  62. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_ro.txt +0 -0
  63. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_ru.txt +0 -0
  64. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_sv.txt +0 -0
  65. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_th.txt +0 -0
  66. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/stopwords_tr.txt +0 -0
  67. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/lang/userdict_ja.txt +0 -0
  68. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/managed-schema +0 -0
  69. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/params.json +0 -0
  70. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/protwords.txt +0 -0
  71. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/solrconfig.xml +0 -0
  72. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/stopwords.txt +0 -0
  73. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/_default/conf/synonyms.txt +0 -0
  74. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/_rest_managed.json +0 -0
  75. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/_schema_analysis_stopwords_english.json +0 -0
  76. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/_schema_analysis_synonyms_english.json +0 -0
  77. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/clustering/carrot2/README.txt +0 -0
  78. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/clustering/carrot2/kmeans-attributes.xml +0 -0
  79. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/clustering/carrot2/lingo-attributes.xml +0 -0
  80. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/clustering/carrot2/stc-attributes.xml +0 -0
  81. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/currency.xml +0 -0
  82. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/elevate.xml +0 -0
  83. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/contractions_ca.txt +0 -0
  84. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/contractions_fr.txt +0 -0
  85. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/contractions_ga.txt +0 -0
  86. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/contractions_it.txt +0 -0
  87. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/hyphenations_ga.txt +0 -0
  88. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stemdict_nl.txt +0 -0
  89. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stoptags_ja.txt +0 -0
  90. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_ar.txt +0 -0
  91. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_bg.txt +0 -0
  92. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_ca.txt +0 -0
  93. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_ckb.txt +0 -0
  94. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_cz.txt +0 -0
  95. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_da.txt +0 -0
  96. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_de.txt +0 -0
  97. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_el.txt +0 -0
  98. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_en.txt +0 -0
  99. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_es.txt +0 -0
  100. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_eu.txt +0 -0
  101. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_fa.txt +0 -0
  102. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_fi.txt +0 -0
  103. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_fr.txt +0 -0
  104. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_ga.txt +0 -0
  105. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_gl.txt +0 -0
  106. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_hi.txt +0 -0
  107. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_hu.txt +0 -0
  108. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_hy.txt +0 -0
  109. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_id.txt +0 -0
  110. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_it.txt +0 -0
  111. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_ja.txt +0 -0
  112. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_lv.txt +0 -0
  113. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_nl.txt +0 -0
  114. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_no.txt +0 -0
  115. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_pt.txt +0 -0
  116. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_ro.txt +0 -0
  117. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_ru.txt +0 -0
  118. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_sv.txt +0 -0
  119. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_th.txt +0 -0
  120. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/stopwords_tr.txt +0 -0
  121. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/lang/userdict_ja.txt +0 -0
  122. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/managed-schema +0 -0
  123. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/mapping-FoldToASCII.txt +0 -0
  124. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/mapping-ISOLatin1Accent.txt +0 -0
  125. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/params.json +0 -0
  126. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/protwords.txt +0 -0
  127. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/solrconfig.xml +0 -0
  128. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/spellings.txt +0 -0
  129. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/stopwords.txt +0 -0
  130. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/synonyms.txt +0 -0
  131. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/update-script.js +0 -0
  132. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/README.txt +0 -0
  133. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/VM_global_library.vm +0 -0
  134. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/browse.vm +0 -0
  135. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/cluster.vm +0 -0
  136. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/cluster_results.vm +0 -0
  137. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/debug.vm +0 -0
  138. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/did_you_mean.vm +0 -0
  139. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/error.vm +0 -0
  140. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/facet_fields.vm +0 -0
  141. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/facet_pivot.vm +0 -0
  142. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/facet_queries.vm +0 -0
  143. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/facet_ranges.vm +0 -0
  144. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/facets.vm +0 -0
  145. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/footer.vm +0 -0
  146. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/head.vm +0 -0
  147. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/header.vm +0 -0
  148. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/hit.vm +0 -0
  149. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/hit_grouped.vm +0 -0
  150. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/hit_plain.vm +0 -0
  151. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/join_doc.vm +0 -0
  152. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/jquery.autocomplete.css +0 -0
  153. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/jquery.autocomplete.js +0 -0
  154. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/layout.vm +0 -0
  155. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/main.css +0 -0
  156. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/mime_type_lists.vm +0 -0
  157. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/pagination_bottom.vm +0 -0
  158. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/pagination_top.vm +0 -0
  159. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/product_doc.vm +0 -0
  160. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/query.vm +0 -0
  161. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/query_form.vm +0 -0
  162. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/query_group.vm +0 -0
  163. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/query_spatial.vm +0 -0
  164. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/results_list.vm +0 -0
  165. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/richtext_doc.vm +0 -0
  166. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/suggest.vm +0 -0
  167. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/velocity/tabs.vm +0 -0
  168. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/xslt/example.xsl +0 -0
  169. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/xslt/example_atom.xsl +0 -0
  170. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/xslt/example_rss.xsl +0 -0
  171. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/xslt/luke.xsl +0 -0
  172. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sample_techproducts_configs/conf/xslt/updateXml.xsl +0 -0
  173. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sunspot/conf/_rest_managed.json +0 -0
  174. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sunspot/conf/admin-extra.html +0 -0
  175. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sunspot/conf/currency.xml +0 -0
  176. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sunspot/conf/elevate.xml +0 -0
  177. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sunspot/conf/lang/stopwords_en.txt +0 -0
  178. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sunspot/conf/mapping-ISOLatin1Accent.txt +0 -0
  179. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sunspot/conf/protwords.txt +0 -0
  180. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sunspot/conf/schema.xml +0 -0
  181. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sunspot/conf/scripts.conf +0 -0
  182. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sunspot/conf/solrconfig.xml +0 -0
  183. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sunspot/conf/spellings.txt +0 -0
  184. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/configsets/sunspot/conf/synonyms.txt +0 -0
  185. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-runner/apps/repositories → grids/grid-solr/config/lib}/.keep +0 -0
  186. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/solr.xml +0 -0
  187. data/lib/smartcloud/{templates/dotsmartcloud/grids/grid-solr/data → grids/grid-solr/config}/zoo.cfg +0 -0
  188. data/lib/smartcloud/grids/mysql.rb +11 -5
  189. data/lib/smartcloud/grids/nginx.rb +7 -4
  190. data/lib/smartcloud/grids/prereceiver.rb +131 -0
  191. data/lib/smartcloud/grids/redmine.rb +57 -0
  192. data/lib/smartcloud/grids/solr.rb +17 -10
  193. data/lib/smartcloud/machine.rb +170 -20
  194. data/lib/smartcloud/ssh.rb +43 -0
  195. data/lib/smartcloud/templates/dotsmartcloud/{grids/grid-solr/data → apps/containers}/.keep +0 -0
  196. data/lib/smartcloud/templates/dotsmartcloud/{grids/grid-solr/data/lib → apps/repositories}/.keep +0 -0
  197. data/lib/smartcloud/templates/dotsmartcloud/bin/smartcloud.sh +9 -0
  198. data/lib/smartcloud/templates/dotsmartcloud/config/environment.rb +5 -3
  199. data/lib/smartcloud/templates/dotsmartcloud/config/users.yml +4 -0
  200. data/lib/smartcloud/{grids → templates/dotsmartcloud/grids}/grid-nginx/fastcgi.conf +1 -1
  201. data/lib/smartcloud/{grids → templates/dotsmartcloud/grids}/grid-nginx/nginx.tmpl +0 -0
  202. data/lib/smartcloud/templates/dotsmartcloud/grids/{grid-runner → grid-prereceiver}/pre-receive +1 -1
  203. data/lib/smartcloud/templates/dotsmartcloud/grids/grid-redmine/files/.keep +0 -0
  204. data/lib/smartcloud/templates/dotsmartcloud/grids/grid-solr/solr/.keep +0 -0
  205. data/lib/smartcloud/templates/dotsmartcloud/tmp/.keep +0 -0
  206. data/lib/smartcloud/user.rb +11 -45
  207. data/lib/smartcloud/version.rb +13 -0
  208. metadata +228 -185
  209. data/bin/runner +0 -20
  210. data/lib/smartcloud/grids/buildpacker.rb +0 -96
  211. data/lib/smartcloud/grids/runner.rb +0 -405
  212. data/lib/smartcloud/templates/dotsmartcloud/grids/grid-nginx/users.yml +0 -1
  213. data/lib/smartcloud/templates/machine/config/machine.yml +0 -5
@@ -5,7 +5,10 @@ module Smartcloud
5
5
  def initialize
6
6
  end
7
7
 
8
- def self.up(exposed)
8
+ def self.up(*args)
9
+ args.flatten!
10
+ exposed = args.empty? ? '' : args.shift
11
+
9
12
  if Smartcloud::Docker.running?
10
13
  # Creating networks
11
14
  unless system("docker network inspect mysql-network", [:out, :err] => File::NULL)
@@ -19,13 +22,16 @@ module Smartcloud
19
22
  print "-----> Creating container mysql ... "
20
23
  if system("docker create \
21
24
  --name='mysql' \
22
- --env MYSQL_RANDOM_ROOT_PASSWORD=yes \
23
- #{"--publish='3306:3306'" if exposed == '--exposed'} \
25
+ --env MYSQL_ROOT_PASSWORD=#{Smartcloud.credentials.mysql[:root_password]} \
26
+ --env MYSQL_USER=#{Smartcloud.credentials.mysql[:username]} \
27
+ --env MYSQL_PASSWORD=#{Smartcloud.credentials.mysql[:password]} \
28
+ --env MYSQL_DATABASE=#{Smartcloud.credentials.mysql[:database_name]} \
29
+ --user `id -u`:`id -g` \
30
+ #{"--publish='#{Smartcloud.credentials.mysql[:port]}:#{Smartcloud.credentials.mysql[:port]}'" if exposed == '--exposed'} \
24
31
  --volume='#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-mysql/data:/var/lib/mysql' \
25
32
  --restart='always' \
26
33
  --network='mysql-network' \
27
- mysql:5.7.27 \
28
- --default-authentication-plugin=mysql_native_password", out: File::NULL)
34
+ mysql:8.0.18", out: File::NULL)
29
35
 
30
36
  puts "done"
31
37
  print "-----> Starting container mysql ... "
@@ -5,7 +5,10 @@ module Smartcloud
5
5
  def initialize
6
6
  end
7
7
 
8
- def self.up(exposed)
8
+ def self.up(*args)
9
+ args.flatten!
10
+ exposed = args.empty? ? '' : args.shift
11
+
9
12
  if Smartcloud::Docker.running?
10
13
  # Creating volumes
11
14
  print "-----> Creating volume nginx-confd ... "
@@ -40,11 +43,11 @@ module Smartcloud
40
43
  --volume='nginx-vhost:/etc/nginx/vhost.d/' \
41
44
  --volume='nginx-shtml:/usr/share/nginx/html' \
42
45
  --volume='#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-nginx/certificates:/etc/nginx/certs' \
43
- --volume='#{Smartcloud.config.root_path}/lib/smartcloud/grids/grid-nginx/fastcgi.conf:/etc/nginx/fastcgi.conf:ro' \
46
+ --volume='#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-nginx/fastcgi.conf:/etc/nginx/fastcgi.conf:ro' \
44
47
  --volume='#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-nginx/htpasswd:/etc/nginx/htpasswd:ro' \
45
48
  --restart='always' \
46
49
  --network='nginx-network' \
47
- nginx", out: File::NULL)
50
+ nginx:alpine", out: File::NULL)
48
51
 
49
52
  puts "done"
50
53
  print "-----> Starting container nginx ... "
@@ -57,7 +60,7 @@ module Smartcloud
57
60
  if system("docker create \
58
61
  --name='nginx-gen' \
59
62
  --volumes-from nginx \
60
- --volume='#{Smartcloud.config.root_path}/lib/smartcloud/grids/grid-nginx/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro' \
63
+ --volume='#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-nginx/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro' \
61
64
  --volume='/var/run/docker.sock:/tmp/docker.sock:ro' \
62
65
  --restart='always' \
63
66
  --network='nginx-network' \
@@ -0,0 +1,131 @@
1
+ # The main Smartcloud Grids Git driver
2
+ module Smartcloud
3
+ module Grids
4
+ class Prereceiver < Smartcloud::Base
5
+
6
+ def initialize
7
+ end
8
+
9
+ def install
10
+ self.uninstall
11
+ unless system("docker image inspect smartcloud/prereceiver", [:out, :err] => File::NULL)
12
+ print "-----> Creating image smartcloud/prereceiver ... "
13
+ if system("docker image build -t smartcloud/prereceiver \
14
+ #{Smartcloud.config.root_path}/lib/smartcloud/grids/grid-prereceiver", out: File::NULL)
15
+ puts "done"
16
+ end
17
+ end
18
+ end
19
+
20
+ def uninstall
21
+ Smartcloud::Grids::Prereceiver.down
22
+ if system("docker image inspect smartcloud/prereceiver", [:out, :err] => File::NULL)
23
+ print "-----> Removing image smartcloud/prereceiver ... "
24
+ if system("docker image rm smartcloud/prereceiver", out: File::NULL)
25
+ puts "done"
26
+ end
27
+ end
28
+ end
29
+
30
+ def self.up
31
+ if Smartcloud::Docker.running?
32
+ if system("docker image inspect smartcloud/prereceiver", [:out, :err] => File::NULL) && system("docker image inspect smartcloud/buildpacks/rails", [:out, :err] => File::NULL)
33
+ print "-----> Creating container prereceiver ... "
34
+ if system("docker create \
35
+ --name='prereceiver' \
36
+ --env VIRTUAL_PROTO=fastcgi \
37
+ --env VIRTUAL_HOST=#{Smartcloud.config.git_domain} \
38
+ --env LETSENCRYPT_HOST=#{Smartcloud.config.git_domain} \
39
+ --env LETSENCRYPT_EMAIL=#{Smartcloud.config.sysadmin_email} \
40
+ --env LETSENCRYPT_TEST=#{Smartcloud.config.letsencrypt_test} \
41
+ --env GIT_PROJECT_ROOT=#{Smartcloud.config.user_home_path}/.smartcloud/apps/repositories \
42
+ --env GIT_HTTP_EXPORT_ALL="" \
43
+ --user `id -u` \
44
+ --workdir /home/`id -un`/.smartcloud/apps \
45
+ --expose='9000' \
46
+ --volume='#{Smartcloud.config.user_home_path}/.smartcloud/config:#{Smartcloud.config.user_home_path}/.smartcloud/config' \
47
+ --volume='#{Smartcloud.config.user_home_path}/.smartcloud/apps:#{Smartcloud.config.user_home_path}/.smartcloud/apps' \
48
+ --volume='#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-prereceiver:#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-prereceiver' \
49
+ --volume='/var/run/docker.sock:/var/run/docker.sock:ro' \
50
+ --restart='always' \
51
+ --network='nginx-network' \
52
+ smartcloud/prereceiver", out: File::NULL)
53
+ puts "done"
54
+
55
+ print "-----> Starting container prereceiver ... "
56
+ if system("docker start prereceiver", out: File::NULL)
57
+ puts "done"
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+
64
+ def self.down
65
+ if Smartcloud::Docker.running?
66
+ # Stopping & Removing containers - in reverse order
67
+ if system("docker inspect -f '{{.State.Running}}' 'prereceiver'", [:out, :err] => File::NULL)
68
+ print "-----> Stopping container prereceiver ... "
69
+ if system("docker stop 'prereceiver'", out: File::NULL)
70
+ puts "done"
71
+
72
+ print "-----> Removing container prereceiver ... "
73
+ if system("docker rm 'prereceiver'", out: File::NULL)
74
+ puts "done"
75
+ end
76
+ end
77
+ else
78
+ puts "-----> Container 'prereceiver' is currently not running."
79
+ end
80
+ end
81
+ end
82
+
83
+ def self.prereceive(appname, username, oldrev, newrev, refname)
84
+ logger.formatter = proc do |severity, datetime, progname, message|
85
+ severity_text = { "DEBUG" => "\u{1f527} #{severity}:", "INFO" => " \u{276f}", "WARN" => "\u{2757} #{severity}:",
86
+ "ERROR" => "\u{274c} #{severity}:", "FATAL" => "\u{2b55} #{severity}:", "UNKNOWN" => "\u{2753} #{severity}:"
87
+ }
88
+ "\t\t\t\t#{severity_text[severity]} #{message}\n"
89
+ end
90
+
91
+ # Load vars and environment
92
+ container_path = "#{Smartcloud.config.user_home_path}/.smartcloud/apps/containers/#{appname}"
93
+ env_vars = Smartcloud::Apps::App.get_env_vars(container_path)
94
+ return unless env_vars
95
+
96
+ # Verify the user and ensure the user is correct and has access to this repository
97
+ unless env_vars['USERNAME'] == username
98
+ logger.error "Unauthorized."
99
+ return
100
+ end
101
+
102
+ # Only run this script for the master branch. You can remove this
103
+ # if block if you wish to run it for others as well.
104
+ if refname == "refs/heads/master"
105
+ logger.info "Loading Application ..."
106
+
107
+ # Note: There should be no space between + and " in version.
108
+ # Note: date will be UTC date until timezone has been changed.
109
+ version = `date +"%Y%m%d%H%M%S"`.chomp!
110
+ container_path_with_version = "#{container_path}/releases/#{version}"
111
+
112
+ unless Dir.exist? container_path_with_version
113
+ FileUtils.mkdir_p(container_path_with_version)
114
+ if system("git archive #{newrev} | tar -x -C #{container_path_with_version}")
115
+ # Start App
116
+ Smartcloud::Apps::App.start(appname)
117
+ else
118
+ logger.fatal "Could not extract new app version ... Failed."
119
+ return
120
+ end
121
+ else
122
+ logger.fatal "This version name already exists ... Failed."
123
+ return
124
+ end
125
+ end
126
+
127
+ logger.formatter = nil
128
+ end
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,57 @@
1
+ # The main Smartcloud Grids Redmine driver
2
+ module Smartcloud
3
+ module Grids
4
+ class Redmine < Smartcloud::Base
5
+ def initialize
6
+ end
7
+
8
+ def self.up
9
+ if Smartcloud::Docker.running?
10
+ # Creating & Starting containers
11
+ print "-----> Creating container redmine ... "
12
+ if system("docker create \
13
+ --name='redmine' \
14
+ --env VIRTUAL_HOST=redmine.#{Smartcloud.config.apps_domain} \
15
+ --env LETSENCRYPT_HOST=redmine.#{Smartcloud.config.apps_domain} \
16
+ --env LETSENCRYPT_EMAIL=#{Smartcloud.config.sysadmin_email} \
17
+ --env LETSENCRYPT_TEST=false \
18
+ --env REDMINE_SECRET_KEY_BASE=#{Smartcloud.credentials.redmine[:secret_key_base]} \
19
+ --env REDMINE_DB_MYSQL=#{Smartcloud.credentials.redmine[:database_host]} \
20
+ --env REDMINE_DB_PORT=#{Smartcloud.credentials.redmine[:database_port]} \
21
+ --env REDMINE_DB_USERNAME=#{Smartcloud.credentials.redmine[:database_username]} \
22
+ --env REDMINE_DB_PASSWORD=#{Smartcloud.credentials.redmine[:database_password]} \
23
+ --env REDMINE_DB_DATABASE=#{Smartcloud.credentials.redmine[:database_name]} \
24
+ --env REDMINE_PLUGINS_MIGRATE=#{Smartcloud.credentials.redmine[:plugins_migrate]} \
25
+ --volume='#{Smartcloud.config.user_home_path}/.smartcloud/apps/repositories:/repositories:ro' \
26
+ --volume='#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-redmine/files:/usr/src/redmine/files' \
27
+ --restart='always' \
28
+ --network='nginx-network' \
29
+ redmine:4.0.5-alpine", out: File::NULL)
30
+
31
+ system("docker network connect mysql-network redmine")
32
+
33
+ puts "done"
34
+ print "-----> Starting container redmine ... "
35
+ if system("docker start redmine", out: File::NULL)
36
+ puts "done"
37
+ end
38
+ end
39
+ end
40
+ end
41
+
42
+ def self.down
43
+ if Smartcloud::Docker.running?
44
+ # Stopping & Removing containers - in reverse order
45
+ print "-----> Stopping container redmine ... "
46
+ if system("docker stop 'redmine'", out: File::NULL)
47
+ puts "done"
48
+ print "-----> Removing container redmine ... "
49
+ if system("docker rm 'redmine'", out: File::NULL)
50
+ puts "done"
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -5,7 +5,10 @@ module Smartcloud
5
5
  def initialize
6
6
  end
7
7
 
8
- def self.up(exposed)
8
+ def self.up(*args)
9
+ args.flatten!
10
+ exposed = args.empty? ? '' : args.shift
11
+
9
12
  if Smartcloud::Docker.running?
10
13
  # Creating networks
11
14
  unless system("docker network inspect solr-network", [:out, :err] => File::NULL)
@@ -15,20 +18,16 @@ module Smartcloud
15
18
  end
16
19
  end
17
20
 
18
- print "-----> Settings permissions solr ... "
19
- if system("sudo chown -R 8983:8983 #{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-solr/data", out: File::NULL)
20
- puts "done"
21
- end
22
-
23
21
  # Creating & Starting containers
24
22
  print "-----> Creating container solr ... "
25
23
  if system("docker create \
26
24
  --name='solr' \
25
+ --user `id -u`:`id -g` \
27
26
  #{"--publish='8983:8983'" if exposed == '--exposed'} \
28
- --volume='#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-solr/data:/opt/solr/server/solr' \
27
+ --volume='#{Smartcloud.config.user_home_path}/.smartcloud/grids/grid-solr/solr:/var/solr' \
29
28
  --restart='always' \
30
29
  --network='solr-network' \
31
- solr:7.5.0", out: File::NULL)
30
+ solr:8.2.0", out: File::NULL)
32
31
 
33
32
  puts "done"
34
33
  print "-----> Starting container solr ... "
@@ -59,7 +58,11 @@ module Smartcloud
59
58
  end
60
59
  end
61
60
 
62
- def self.create_core(corename)
61
+ # TODO: self.create_core method must be checked line by line to see if its working properly for solr8 and above
62
+ def self.create_core(*args)
63
+ args.flatten!
64
+ corename = args.empty? ? '' : args.shift
65
+
63
66
  if Smartcloud::Docker.running?
64
67
  puts "-----> Creating core #{corename} ... "
65
68
  if system("docker exec -it --user=solr solr solr create_core -c #{corename}")
@@ -77,7 +80,11 @@ module Smartcloud
77
80
  end
78
81
  end
79
82
 
80
- def self.destroy_core(corename)
83
+ # TODO: self.destroy_core method must be checked line by line to see if its working properly for solr8 and above
84
+ def self.destroy_core(*args)
85
+ args.flatten!
86
+ corename = args.empty? ? '' : args.shift
87
+
81
88
  if Smartcloud::Docker.running?
82
89
  puts "-----> Removing core #{corename} ... "
83
90
  if system("docker exec -it --user=solr solr solr delete -c #{corename}")
@@ -6,6 +6,80 @@ module Smartcloud
6
6
  def initialize
7
7
  end
8
8
 
9
+ def create(*args)
10
+ args.flatten!
11
+
12
+ name = args.shift
13
+ FileUtils.mkdir name
14
+ FileUtils.cp_r "#{Smartcloud.config.root_path}/lib/smartcloud/templates/dotsmartcloud/.", "#{name}"
15
+ FileUtils.chdir "#{name}" do
16
+ credentials = Smartcloud::Credentials.new
17
+ credentials.create
18
+ end
19
+ puts "New machine #{name} has been created."
20
+ end
21
+
22
+ def start
23
+ Smartcloud::Docker.install
24
+
25
+ engine = Smartcloud::Engine.new
26
+ engine.install
27
+
28
+ ssh = Smartcloud::SSH.new
29
+ ssh.run "smartcloud buildpacker install"
30
+ ssh.run "smartcloud prereceiver install"
31
+ end
32
+
33
+ def stop
34
+ ssh = Smartcloud::SSH.new
35
+ ssh.run "smartcloud prereceiver uninstall"
36
+ ssh.run "smartcloud buildpacker uninstall"
37
+
38
+ engine = Smartcloud::Engine.new
39
+ engine.uninstall
40
+
41
+ Smartcloud::Docker.uninstall
42
+ end
43
+
44
+ def grid(*args)
45
+ args.flatten!
46
+
47
+ ssh = Smartcloud::SSH.new
48
+ ssh.run "smartcloud run grid #{args.join(" ")}"
49
+ end
50
+
51
+ def app(*args)
52
+ args.flatten!
53
+
54
+ ssh = Smartcloud::SSH.new
55
+ ssh.run "smartcloud run app #{args.join(" ")}"
56
+ end
57
+
58
+ def ssh
59
+ ssh = Smartcloud::SSH.new
60
+ ssh.login
61
+ end
62
+
63
+ # Works only for class methods of the class as no instance of the class is created
64
+ def run(*args)
65
+ args.flatten!
66
+
67
+ controller_type = args.shift.pluralize
68
+
69
+ if controller_type == "grids"
70
+ controller_name = args.shift
71
+ elsif controller_type == "apps"
72
+ controller_name = "app"
73
+ else
74
+ raise "Invalid run command. Please try again."
75
+ end
76
+
77
+ controller = "Smartcloud::#{controller_type.capitalize}::#{controller_name.capitalize}"
78
+ action = args.shift.to_sym
79
+
80
+ args.empty? ? Object.const_get(controller).public_send(action) : Object.const_get(controller).public_send(action, args)
81
+ end
82
+
9
83
  def getting_started
10
84
  # puts 'You may be prompted to make a menu selection when the Grub package is updated on Ubuntu. If prompted, select keep the local version currently installed.'
11
85
 
@@ -62,25 +136,101 @@ module Smartcloud
62
136
  # sudo fail2ban-client status
63
137
  end
64
138
 
65
- # def create(name)
66
- # FileUtils.mkdir_p name
67
- # FileUtils.cp_r "#{Smartcloud.config.root_path}/lib/smartcloud/templates/machine/.", "#{name}"
68
- # puts "Please fill details in your config folder before proceeding."
69
- # end
70
- #
71
- # def run(*args)
72
- # end
73
- #
74
- # def install_docker
75
- # end
76
- #
77
- # def uninstall_docker
78
- # end
79
- #
80
- # def install_engine
81
- # end
82
- #
83
- # def uninstall_engine
84
- # end
139
+ def self.smartcloud_local?
140
+ File.file?("./config/master.key")
141
+ end
142
+
143
+ def self.smartcloud_server?
144
+ File.directory?("#{Smartcloud.config.user_home_path}/.smartcloud")
145
+ end
146
+
147
+ def sync(first_sync = false)
148
+ puts "-----> Syncing smartcloud ... "
149
+ return sync_push if first_sync
150
+
151
+ unless block_given?
152
+ sync_pull && sync_push
153
+ else
154
+ sync_pull
155
+ yield
156
+ sync_push
157
+ end
158
+ end
159
+
160
+ private
161
+
162
+ def sync_pull
163
+ puts "-----> Sync pulling ... "
164
+ system("rsync -azumv --delete --include={#{sync_pull_files_list}} --exclude=* -e ssh #{Smartcloud.credentials.machine[:username]}@#{Smartcloud.credentials.machine[:host]}:~/.smartcloud/ .")
165
+ end
166
+
167
+ def sync_push
168
+ puts "-----> Sync pushing ... "
169
+ system("rsync -azumv --delete --include={#{sync_push_files_list}} --exclude=* -e ssh ./ #{Smartcloud.credentials.machine[:username]}@#{Smartcloud.credentials.machine[:host]}:~/.smartcloud")
170
+ end
171
+
172
+ def sync_pull_files_list
173
+ files = [
174
+ 'apps/***',
175
+
176
+ 'grids',
177
+
178
+ 'grids/grid-mysql',
179
+ 'grids/grid-mysql/data/***',
180
+
181
+ 'grids/grid-nginx',
182
+ 'grids/grid-nginx/certificates/***',
183
+
184
+ 'grids/grid-redmine',
185
+ 'grids/grid-redmine/files/***',
186
+
187
+ 'grids/grid-solr',
188
+ 'grids/grid-solr/solr/***',
189
+ ]
190
+ files.join(',')
191
+ end
192
+
193
+ def sync_push_files_list
194
+ files = [
195
+ 'apps',
196
+ 'apps/containers',
197
+ 'apps/containers/.keep',
198
+ 'apps/repositories',
199
+ 'apps/repositories/.keep',
200
+
201
+ 'bin/***',
202
+
203
+ 'config',
204
+ 'config/credentials.yml.enc',
205
+ 'config/environment.rb',
206
+
207
+ 'grids',
208
+
209
+ 'grids/grid-mysql',
210
+ 'grids/grid-mysql/data',
211
+ 'grids/grid-mysql/data/.keep',
212
+
213
+ 'grids/grid-nginx',
214
+ 'grids/grid-nginx/certificates',
215
+ 'grids/grid-nginx/certificates/.keep',
216
+ 'grids/grid-nginx/htpasswd/***',
217
+ 'grids/grid-nginx/fastcgi.conf',
218
+ 'grids/grid-nginx/nginx.tmpl',
219
+
220
+ 'grids/grid-prereceiver',
221
+ 'grids/grid-prereceiver/pre-receive',
222
+
223
+ 'grids/grid-redmine',
224
+ 'grids/grid-redmine/files',
225
+ 'grids/grid-redmine/files/.keep',
226
+
227
+ 'grids/grid-solr',
228
+ 'grids/grid-solr/solr',
229
+ 'grids/grid-solr/solr/.keep',
230
+
231
+ 'tmp/***',
232
+ ]
233
+ files.join(',')
234
+ end
85
235
  end
86
236
  end