Add template that installs depencencies for MSSQL Server
authorGerhard Schlager <mail@gerhard-schlager.at>
Tue, 26 Jun 2018 15:45:16 +0000 (17:45 +0200)
committerGerhard Schlager <mail@gerhard-schlager.at>
Tue, 26 Jun 2018 15:47:48 +0000 (17:47 +0200)
templates/import/mssql-dep.template.yml [new file with mode: 0644]

diff --git a/templates/import/mssql-dep.template.yml b/templates/import/mssql-dep.template.yml
new file mode 100644 (file)
index 0000000..44cdf7a
--- /dev/null
@@ -0,0 +1,24 @@
+# This template adds the 'tiny_tds' gem for import scripts depending on it
+
+params:
+  home: /var/www/discourse
+
+hooks:
+  after_web_config:
+    - exec:
+        cd: /tmp
+        cmd:
+          - wget -O freetds.tar.gz http://www.freetds.org/files/stable/freetds-1.00.91.tar.gz
+          - tar -xzf freetds.tar.gz
+    - exec:
+        cd: /tmp/freetds-*
+        cmd:
+          - ./configure --prefix=/usr/local --with-tdsver=7.3
+          - make && make install
+
+  after_bundle_exec:
+    - exec:
+        cd: $home
+        cmd:
+          - echo "gem 'tiny_tds'" >> Gemfile
+          - su discourse -c 'bundle install --no-deployment --without test --without development --path vendor/bundle'