Skip to content

Commit

Permalink
Small improvements to tutorial and launching rails console. (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
javierdelapuente authored Apr 9, 2024
1 parent 85bd878 commit 2f0ed98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions docs/how-to/access--the-rails-console.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@ Then ssh into the Discourse unit:
```
juju ssh --container discourse discourse-k8s/leader bash
```
Now populate the required environment variables, this requires charm revision 70 or greater:
Now access the console using Pebble:
```
sudo -u _daemon_ xargs -0 -L1 -a "/proc/$(ps aux | awk '/[u]nicorn master/ {print $2;exit}')/environ" | awk '{FS="=";print "export " $1 "=\"" $2 "\""}' > /root/envi && . /root/envi && rm /root/envi
```
Now change to the appropriate directory and execute the command to access the console:
```
cd /srv/discourse/app
RAILS_ENV=production bin/bundle exec rails console
pebble exec --user=_daemon_ --context=discourse -w=/srv/discourse/app -ti -- /srv/discourse/app/bin/bundle exec rails console
```
If the output of the last command contains something similar to this:
```
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ All the above charms will the deployed in a new model named `discourse`:
juju add-model discourse
# Deploy the charms
juju deploy redis-k8s
juju deploy redis-k8s --channel latest/edge
juju deploy postgresql-k8s --channel 14/stable --trust
juju deploy discourse-k8s
Expand All @@ -31,7 +31,7 @@ juju config postgresql-k8s plugin_pg_trgm_enable=True
# Relate redis-k8s and postgresql-k8s to discourse-k8s
juju relate redis-k8s discourse-k8s
juju relate discourse-k8s postgresql-k8s:db
juju relate discourse-k8s postgresql-k8s
```

Expand Down

0 comments on commit 2f0ed98

Please sign in to comment.