1
0
Fork 0
forked from OpenNeo/impress

Convenient shell things when logging in as impress user in production

Now, if I run `sudo -i -u impress` on the production server, it opens a
login bash shell, with all of the app's environment variables exported,
straight to `/srv/impress`.

This will let me quickly `cd current; bin/rails console` to start poking
at whatever needs poked!
This commit is contained in:
Emi Matchu 2023-10-24 16:03:22 -07:00
parent d33395fda9
commit d5abc65dc9

View file

@ -98,7 +98,9 @@
user: user:
name: impress name: impress
comment: Impress App comment: Impress App
home: /srv/impress
create_home: false create_home: false
shell: /bin/bash
- name: Create "impress-deployers" group - name: Create "impress-deployers" group
group: group:
@ -172,6 +174,18 @@
mode: "755" mode: "755"
state: directory state: directory
- name: Add a convenient .bash_profile for when we log in as "impress"
copy:
owner: impress
group: impress
dest: /srv/impress/.bash_profile
content: |
set -a # Export all of the below
RAILS_ENV=production
EXECJS_RUNTIME=Disabled
source /srv/impress/shared/production.env
set +a
- name: Create the app's "versions" folder - name: Create the app's "versions" folder
become_user: impress become_user: impress
file: file: