From 553a4fc9a6c426524cae3634335913becd654d62 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 21 Mar 2014 16:06:12 +1100 Subject: [PATCH] more useful motd message, added shortcut for various tools --- templates/sshd.template.yml | 12 ++++++++++++ templates/web.template.yml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/templates/sshd.template.yml b/templates/sshd.template.yml index c4ca4f6..888e834 100644 --- a/templates/sshd.template.yml +++ b/templates/sshd.template.yml @@ -25,3 +25,15 @@ run: - echo "$ssh_key" >> /root/.ssh/authorized_keys - echo "$$ENV_SSH_PUB_KEY" >> /root/.ssh/authorized_keys - chmod 640 /root/.ssh/authorized_keys + - rm /etc/update-motd.d/00-header + - rm /etc/update-motd.d/10-help-text + - rm /etc/update-motd.d/99-footer + - rm /etc/legal + - file: + path: /etc/update-motd.d/00-discourse + chmod: +x + contents: | + #!/bin/sh + echo + echo Welcome to Discourse Docker + echo diff --git a/templates/web.template.yml b/templates/web.template.yml index 4912d08..ee53dde 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -130,3 +130,33 @@ run: - sudo -E -u discourse bundle exec rake db:migrate - sudo -E -u discourse bundle exec rake assets:precompile + - file: + path: /usr/local/bin/discourse + chmod: +x + contents: | + #!/bin/bash + (cd /var/www/discourse && RAILS_ENV=production sudo -E -u discourse bundle exec script/discourse "$@") + + - file: + path: /usr/local/bin/rails + chmod: +x + contents: | + #!/bin/bash + (cd /var/www/discourse && RAILS_ENV=production sudo -E -u discourse bundle exec script/rails "$@") + + - file: + path: /usr/local/bin/rake + chmod: +x + contents: | + #!/bin/bash + (cd /var/www/discourse && RAILS_ENV=production sudo -E -u discourse bundle exec bin/rake "$@") + + - file: + path: /etc/update-motd.d/10-web + chmod: +x + contents: | + #!/bin/bash + echo + echo Use: rails, rake or discourse to execute commands in production + echo + -- 2.25.1