From d5abc65dc9ca4b906f9340450ebecc568e6926f1 Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 24 Oct 2023 16:03:22 -0700 Subject: [PATCH] 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! --- deploy/setup.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/deploy/setup.yml b/deploy/setup.yml index 244f55b9..50c52d22 100644 --- a/deploy/setup.yml +++ b/deploy/setup.yml @@ -98,7 +98,9 @@ user: name: impress comment: Impress App + home: /srv/impress create_home: false + shell: /bin/bash - name: Create "impress-deployers" group group: @@ -172,6 +174,18 @@ mode: "755" 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 become_user: impress file: