From f2d50d70087394d4a470137e05106016b64a1c9e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Juan=20David=20Mart=C3=ADnez=20Cubillos?= Date: Tue, 30 Jul 2024 17:11:11 +0200 Subject: [PATCH] DEV: Updated vanilla.template.yml (#817) * DEV: Updated vanilla.template.yml * updated vanilla.template.yml to make the migration process more straight forward * removed branch pull * implemented suggested changes * added suggested chantes * added before_code hook to set remote fork * updated with suggested changes --- templates/import/vanilla.template.yml | 30 +++++++++++++++------------ 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/templates/import/vanilla.template.yml b/templates/import/vanilla.template.yml index 78802a2..a454eaf 100644 --- a/templates/import/vanilla.template.yml +++ b/templates/import/vanilla.template.yml @@ -1,17 +1,13 @@ # This template installs MariaDB and all dependencies needed for importing from vanilla. +env: + UNICORN_SIDEKIQS: 0 + params: home: /var/www/discourse hooks: after_web_config: - - exec: - cd: /etc/service - cmd: - - rm -R unicorn - - rm -R nginx - - rm -R cron - - exec: cd: /etc/runit/3.d cmd: @@ -36,7 +32,7 @@ hooks: - exec: cmd: - mkdir -p /shared/import/mysql/data - - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y nano libmariadbclient-dev mariadb-server + - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y nano libmariadb-dev mariadb-server - sed -Ei 's/^log/#&/' /etc/mysql/my.cnf - file: @@ -95,22 +91,30 @@ hooks: sv stop mysql fi - cd $home - echo "The Vanilla import is starting..." - echo - su discourse -c 'bundle exec ruby script/import_scripts/vanilla.rb' + echo "import_vanilla.sh completed" - exec: cd: $home cmd: - mkdir -p /shared/import/data - chown discourse -R /shared/import + + before_code: + - exec: + cd: $home + cmd: + # Add your discourse core fork and pull custom code + - su discourse -c 'git remote set-url origin https://github.com/{github_username}/discourse.git' after_bundle_exec: - exec: cd: $home cmd: - - echo "gem 'mysql2'" >> Gemfile + # Add the gems used in the script + - echo "gem 'mysql2'" >> Gemfile - echo "gem 'ruby-bbcode-to-md', :github => 'nlalonde/ruby-bbcode-to-md'" >> Gemfile - su discourse -c 'bundle config unset deployment' - su discourse -c 'bundle install --no-deployment --path vendor/bundle --jobs 4 --without test development' + - service mariadb start + # imports the DB into mysql + - sh /usr/local/bin/import_flarum_test.sh -- 2.25.1