FIX: Don't install test gems in production.
[discourse_docker.git] / templates / import / mbox.template.yml
CommitLineData
433f2ee3
GS
1# This template configures the container for importing emails and mbox files.
2
3params:
4 home: /var/www/discourse
5
6hooks:
7 after_web_config:
433f2ee3
GS
8 - file:
9 path: /usr/local/bin/import_mbox.sh
10 chmod: "+x"
11 contents: |
12 #!/bin/bash
13 set -e
14
15 chown discourse /shared/import/settings.yml
16 chown discourse -R /shared/import/data
17
18 cd $home
19 echo "The mbox import is starting..."
20 echo
309d1242 21 su discourse -c 'bundle exec ruby script/import_scripts/mbox.rb /shared/import/settings.yml'
433f2ee3
GS
22
23 - exec:
24 cd: $home
25 cmd:
26 - mkdir -p /shared/import/data
27 - chown discourse -R /shared/import
28 - cp -n script/import_scripts/mbox/settings.yml /shared/import/settings.yml
29
30 after_bundle_exec:
31 - exec:
32 cd: $home
33 cmd:
b9f89fce
GS
34 - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y libsqlite3-dev
35 - echo "gem 'sqlite3'" >> Gemfile
b8866fb9 36 - su discourse -c 'bundle install --no-deployment --path vendor/bundle --jobs 4 --without test development'