Skip to content
Snippets Groups Projects
Commit 8194c5ae authored by Jan Mach's avatar Jan Mach
Browse files

Do not connect immediatelly as mentat system user to Vagrant box.

Some commands need to be run as vagrant user due to the ownership of
/vagrant/ directory.

(Redmine issue: #7041)
parent fe823873
No related branches found
No related tags found
No related merge requests found
...@@ -31,7 +31,7 @@ Vagrant.configure('2') do |config| ...@@ -31,7 +31,7 @@ Vagrant.configure('2') do |config|
SHELL SHELL
# Automatically connect as 'mentat' user with ssh command. # Automatically connect as 'mentat' user with ssh command.
VAGRANT_COMMAND = ARGV[0] # VAGRANT_COMMAND = ARGV[0]
config.ssh.username = 'mentat' if VAGRANT_COMMAND == 'ssh' # config.ssh.username = 'mentat' if VAGRANT_COMMAND == 'ssh'
config.ssh.extra_args = ['-t', 'cd /vagrant; bash --login'] config.ssh.extra_args = ['-t', 'cd /vagrant; bash --login']
end end
...@@ -107,6 +107,7 @@ alias ..='cd ..' ...@@ -107,6 +107,7 @@ alias ..='cd ..'
alias ...='cd ../..' alias ...='cd ../..'
alias ....='cd ../../..' alias ....='cd ../../..'
alias sm='sudo su mentat' alias sm='sudo su mentat'
alias sv='sudo su vagrant'
alias wd='cd /vagrant/' alias wd='cd /vagrant/'
alias ve='source /var/mentat/venv/bin/activate' alias ve='source /var/mentat/venv/bin/activate'
......
...@@ -21,6 +21,9 @@ dpkg-reconfigure -f noninteractive tzdata && \ ...@@ -21,6 +21,9 @@ dpkg-reconfigure -f noninteractive tzdata && \
dpkg-reconfigure --frontend=noninteractive locales && \ dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8 update-locale LANG=en_US.UTF-8
echo "==========> Preparing system for development"
chmod g+w /vagrant
echo "==========> Creating Mentat user for development" echo "==========> Creating Mentat user for development"
if ! getent passwd ${MENTAT_USER} > /dev/null 2>&1; then if ! getent passwd ${MENTAT_USER} > /dev/null 2>&1; then
useradd -m -s /bin/bash -U ${MENTAT_USER} --groups sudo useradd -m -s /bin/bash -U ${MENTAT_USER} --groups sudo
......
...@@ -18,6 +18,8 @@ echo " Flask web interface located at: http://localhost:5000" ...@@ -18,6 +18,8 @@ echo " Flask web interface located at: http://localhost:5000"
echo " Sendria web interface located at: http://localhost:1080" echo " Sendria web interface located at: http://localhost:1080"
echo "" echo ""
echo " Tips:" echo " Tips:"
echo " Use command alias 'sm' to quickly sudo su to mentat system user"
echo " Use command alias 'sv' to quickly sudo su to vagrant system user"
echo " Use command alias 'wd' to quickly change to project's work directory." echo " Use command alias 'wd' to quickly change to project's work directory."
echo " Use command alias 've' to activate project's virtual environment." echo " Use command alias 've' to activate project's virtual environment."
echo "" echo ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment