adding mysql dependency template to simplify usage of import scripts
authorlead4good <lead4good@@users.noreply.github.com>
Thu, 25 May 2017 10:12:25 +0000 (12:12 +0200)
committerlead4good <lead4good@@users.noreply.github.com>
Thu, 25 May 2017 10:12:25 +0000 (12:12 +0200)
templates/import/mysql-dep.template.yml [new file with mode: 0644]

diff --git a/templates/import/mysql-dep.template.yml b/templates/import/mysql-dep.template.yml
new file mode 100644 (file)
index 0000000..dab0853
--- /dev/null
@@ -0,0 +1,13 @@
+# This template adds the 'mysql2' gem for import scripts depending on it
+
+params:
+  home: /var/www/discourse
+
+hooks:
+  after_bundle_exec:
+    - exec:
+        cd: $home
+        cmd:
+          - echo "gem 'mysql2'" >> Gemfile
+          - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y libmysqlclient-dev
+          - su discourse -c 'bundle install --no-deployment --without test --without development --path vendor/bundle'