Update pups repo to correct .git URL (#393)
[discourse_docker.git] / templates / import / mbox.template.yml
1 # This template configures the container for importing emails and mbox files.
2
3 params:
4 home: /var/www/discourse
5
6 hooks:
7 after_web_config:
8 - exec:
9 cd: /etc/service
10 cmd:
11 - rm -R unicorn
12 - rm -R nginx
13 - rm -R cron
14
15 - exec:
16 cd: /etc/runit/3.d
17 cmd:
18 - rm 01-nginx
19 - rm 02-unicorn
20
21 - file:
22 path: /usr/local/bin/import_mbox.sh
23 chmod: "+x"
24 contents: |
25 #!/bin/bash
26 set -e
27
28 chown discourse /shared/import/settings.yml
29 chown discourse -R /shared/import/data
30
31 cd $home
32 echo "The mbox import is starting..."
33 echo
34 su discourse -c 'IMPORT=1 bundle exec ruby script/import_scripts/mbox-experimental.rb /shared/import/settings.yml'
35
36 - exec:
37 cd: $home
38 cmd:
39 - mkdir -p /shared/import/data
40 - chown discourse -R /shared/import
41 - cp -n script/import_scripts/mbox/settings.yml /shared/import/settings.yml
42
43 after_bundle_exec:
44 - exec:
45 cd: $home
46 cmd:
47 - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y libmysqlclient-dev libsqlite3-dev
48 - su discourse -c 'IMPORT=1 bundle install --no-deployment --without test --without development --path vendor/bundle'