Commit | Line | Data |
---|---|---|
36613df9 | 1 | run: |
02da1cc9 S |
2 | |
3 | - replace: | |
4 | filename: "/etc/postgresql/9.5/main/postgresql.conf" | |
5 | from: /#?fullpage_writes *=.*/ | |
6 | to: "fullpage_writes = off" | |
7 | ||
8 | - replace: | |
9 | filename: "/etc/postgresql/9.5/main/postgresql.conf" | |
10 | from: /#?fsync *=.*/ | |
11 | to: "fsync = off" | |
12 | ||
36613df9 S |
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/9.5/bin/postmaster -D /etc/postgresql/9.5/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 | - exec: cd tmp && git clone https://github.com/discourse/discourse.git --depth=1 && cd /tmp/discourse && sudo -u discourse bundle install | |
38 | - exec: chown -R discourse /tmp/discourse | |
39 | - exec: cd /tmp/discourse && sudo -u discourse bundle exec rake db:migrate | |
364df298 | 40 | - exec: cd /tmp/discourse && sudo -u discourse RAILS_ENV=test bundle exec rake db:migrate |
36613df9 | 41 | - exec: rm -fr /tmp/discourse |