-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnect_local_db.sh
More file actions
executable file
·29 lines (24 loc) · 1.05 KB
/
connect_local_db.sh
File metadata and controls
executable file
·29 lines (24 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
export DATABASE_HOST=localhost
export DATABASE_PORT=5432
export DATABASE_USER=gitpod
unset DATABASE_PASSWORD
export DATABASE_DB=postgres
export DATABASE_URL=postgresql://gitpod@localhost
export PGHOSTADDR=127.0.0.1
export DECIDIM_HOST="3000-$GITPOD_WORKSPACE_ID.$GITPOD_WORKSPACE_CLUSTER_HOST"
export DECIDIM_FOLLOW_HTTP_X_FORWARDED_HOST=true
export DECIDIM_FORCE_SSL=false
export DECIDIM_ALLOW_OPEN_REDIRECTS=true
unset DATABASE_HOST
unset DATABASE_PORT
unset DATABASE_DB
RAILS_ENV=development bin/rails db:environment:set
# bin/rails db:drop
# bin/rails db:create
# pg_restore -d decidim_application_development db/myrevolution-staging.pgdump
# RAILS_ENV=development bin/rails db:environment:set
echo "update remote organization hostname"
echo "UPDATE decidim_organizations SET host='3000-$GITPOD_WORKSPACE_ID.$GITPOD_WORKSPACE_CLUSTER_HOST';" | bundle exec rails dbconsole -p
# echo 'Decidim::User.first.update(accepted_tos_version: DateTime.now, admin_terms_accepted_at: DateTime.now, password_updated_at: DateTime.now)' | bundle exec rails c
bin/rails server