PageRenderTime 70ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/config/deploy.rb

https://bitbucket.org/hon3y/hny_project_typo3
Ruby | 119 lines | 31 code | 14 blank | 74 comment | 1 complexity | 682a48a60b8b782b2645ed34aff47889 MD5 | raw file
  1. # config valid only for current version of Capistrano
  2. lock '3.5.0'
  3. set :application, "<customer_abbr>_<yy>_<type>-deploy"
  4. ##
  5. ## :repo_url
  6. ##
  7. ## e.g. set :repo_url, 'git@bitbucket.org:hon3y/teu_18_ws_installer.git'
  8. ##
  9. set :repo_url, "git@bitbucket.org:<team>/<customer_abbr>_<yy>_<type>_installer.git"
  10. set :branch, ENV['REVISION'] || ENV['BRANCH_NAME']
  11. set :keep_releases, 1
  12. ####################################################################################################################
  13. ##
  14. ## Mittwald:
  15. ##
  16. # Rake::Task["deploy:check"].clear_actions
  17. ##
  18. ####################################################################################################################
  19. namespace :deploy do
  20. ####################################################################################################################
  21. ##
  22. ## Mittwald:
  23. ##
  24. # task check: :'git:wrapper' do
  25. # on release_roles :all do
  26. # ####################################################################################################################
  27. # ##
  28. # ## /usr/bin/ssh not present at mittwald servers
  29. # ## Use /usr/local/bin/ssh instead
  30. # ##
  31. # execute :mkdir, "-p", "#{fetch(:tmp_dir)}/#{fetch(:application)}/"
  32. # upload! StringIO.new("#!/bin/sh -e\nexec /usr/local/bin/ssh -o PasswordAuthentication=no -o StrictHostKeyChecking=no \"$@\"\n"), "#{fetch(:tmp_dir)}/#{fetch(:application)}/git-ssh.sh"
  33. # execute :chmod, "+x", "#{fetch(:tmp_dir)}/#{fetch(:application)}/git-ssh.sh"
  34. # ##
  35. # ####################################################################################################################
  36. # end
  37. # end
  38. ##
  39. ####################################################################################################################
  40. task :composer do
  41. on roles(:web) do
  42. within release_path do
  43. execute :chmod, '-R', '775', './web'
  44. execute :chmod, '-R', '775', './composer.json'
  45. execute "echo '#{fetch(:hon3y_database_ini)}'"
  46. ####################################################################################################################
  47. ##
  48. ## DomainFactory:
  49. ##
  50. execute 'wget', '-q', '-nc', 'https://getcomposer.org/composer.phar'
  51. execute "#{fetch(:hon3y_php_cli_bin)}", "-c", "./php.ini" , './composer.phar', 'install', '--no-dev', '--no-ansi', '--no-interaction'
  52. ##
  53. ## Mittwald:
  54. # execute :composer, 'install', '--no-dev', '--no-ansi', '--no-interaction'
  55. ##
  56. ####################################################################################################################
  57. ####################################################################################################################
  58. ##
  59. ## Uncomment if not using PHP with CGI !!!
  60. ##
  61. #execute :mv, "./web/index.php", "./web/_index.php"
  62. #execute :cp, "./vendor/typo3/cms/index.php", "./web"
  63. ##
  64. ####################################################################################################################
  65. execute :ln, "-s", "#{fetch(:hon3y_database_ini)}", "./web/typo3conf/server.ini"
  66. execute :ln, "-s", "#{fetch(:hon3y_sudo_ini)}", "./sudo.ini"
  67. ####################################################################################################################
  68. ##
  69. ## Add shared folders below !!!
  70. ##
  71. execute :ln, "-s", "#{fetch(:hon3y_fileadmin)}", "./web/fileadmin"
  72. execute :ln, "-s", "#{fetch(:hon3y_uploads)}", "./web/uploads"
  73. ##
  74. ## Mittwald (additional):
  75. ##
  76. # execute :ln, "-s", "#{fetch(:hon3y_gulp)}", "./web/typo3conf/ext/#{fetch(:hon3y_custom_extension)}/Resources/Public/Assets/Gulp"
  77. ##
  78. ####################################################################################################################
  79. execute :sh, "./install_typo3.sh", "#{fetch(:hon3y_php_cli_bin)}"
  80. # ./temp_defaults-extra-file.cnf created has been created in ./install_typo3.sh
  81. execute :mysql, "--defaults-extra-file=./temp_defaults-extra-file.cnf", "--default-character-set=utf8", "<", "#{fetch(:hon3y_database_dump_definition)}"
  82. execute :mysql, "--defaults-extra-file=./temp_defaults-extra-file.cnf", "--default-character-set=utf8", "<", "#{fetch(:hon3y_database_dump_data)}"
  83. execute :sh, "./install_typo3_extensions.sh", "#{fetch(:hon3y_php_cli_bin)}"
  84. ####################################################################################################################
  85. ##
  86. ## Uncomment if hosting at Mittwald !!!
  87. ##
  88. execute :sh, "./install_npm_packages.sh"
  89. execute "#{fetch(:hon3y_node_modules_bin)}/gulp"
  90. ##
  91. ####################################################################################################################
  92. execute :rm, "-f", "./temp_defaults-extra-file.cnf"
  93. ####################################################################################################################
  94. ##
  95. ## Uncomment if using PHP with opcache enabled !!!
  96. ##
  97. #execute "#{fetch(:hon3y_php_bin)}", "-c", "./php.ini" , './opcache_reset.php'
  98. ##
  99. ####################################################################################################################
  100. execute :touch, "./web/typo3conf/ENABLE_INSTALL_TOOL"
  101. end
  102. end
  103. end
  104. after :updated, 'deploy:composer'
  105. end