tweaks required to get this to build... ruby now needs ruby to install ruby
[discourse_docker.git] / image / discourse_dev / postgres_dev.template.yml
1 run:
2
3 - replace:
4 filename: "/etc/postgresql/10/main/postgresql.conf"
5 from: /#?fullpage_writes *=.*/
6 to: "fullpage_writes = off"
7
8 - replace:
9 filename: "/etc/postgresql/10/main/postgresql.conf"
10 from: /#?fsync *=.*/
11 to: "fsync = off"
12
13 - exec:
14 background: true
15 # use fast shutdown for pg
16 stop_signal: INT
17 cmd: HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main
18
19 - exec:
20 background: true
21 cmd: exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
22
23 # give db a few secs to start up
24 - exec: "sleep 5"
25
26 - exec: su postgres -c 'createdb discourse_development' || true
27 - exec: su postgres -c 'psql discourse_development -c "grant all privileges on database discourse_development to discourse;"' || true
28 - exec: su postgres -c 'psql discourse_development -c "alter schema public owner to discourse;"'
29 - exec: su postgres -c 'psql discourse_development -c "create extension if not exists hstore;"'
30 - exec: su postgres -c 'psql discourse_development -c "create extension if not exists pg_trgm;"'
31
32 - exec: su postgres -c 'createdb discourse_test' || true
33 - exec: su postgres -c 'psql discourse_test -c "grant all privileges on database discourse_test to discourse;"' || true
34 - exec: su postgres -c 'psql discourse_test -c "alter schema public owner to discourse;"'
35 - exec: su postgres -c 'psql discourse_test -c "create extension if not exists hstore;"'
36 - exec: su postgres -c 'psql discourse_test -c "create extension if not exists pg_trgm;"'
37
38 - exec: su postgres -c 'createdb discourse_test_multisite' || true
39 - exec: su postgres -c 'psql discourse_test_multisite -c "grant all privileges on database discourse_test_multisite to discourse;"' || true
40 - exec: su postgres -c 'psql discourse_test_multisite -c "alter schema public owner to discourse;"'
41 - exec: su postgres -c 'psql discourse_test_multisite -c "create extension if not exists hstore;"'
42 - exec: su postgres -c 'psql discourse_test_multisite -c "create extension if not exists pg_trgm;"'
43
44 - exec: cd tmp && git clone https://github.com/discourse/discourse.git --depth=1 && cd /tmp/discourse && sudo -u discourse bundle install
45 - exec: chown -R discourse /tmp/discourse
46 - exec: cd /tmp/discourse && sudo -u discourse bundle exec rake db:migrate
47 - exec: cd /tmp/discourse && sudo -u discourse RAILS_ENV=test bundle exec rake db:migrate
48 - exec: rm -fr /tmp/discourse