Bug 1170167 - Vagrant: cd into the treeherder directory on login

Also switches the activate-venv-on-login .bashrc entry to use an
absolute path, in case it gets added to .bashrc after the 'cd' line.
This commit is contained in:
Ed Morley 2015-06-01 16:42:46 +01:00
Родитель 6d813129a4
Коммит 81c5c67a2a
3 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -50,17 +50,13 @@ Setting up Vagrant
* It will typically take 5 to 30 minutes for the vagrant up to complete, depending on your network performance.
* Once the virtual machine is set up, in any shell, cd into your project root and log into it with
* Once the virtual machine is set up, log into it with
.. code-block:: bash
>vagrant ssh
* A python virtual environment will be activated on login, all that is left to do is cd into the project directory:
.. code-block:: bash
(venv)vagrant@precise32:~$ cd treeherder
A python virtual environment will be activated on login, and the working directory will be the treeherder source directory shared from the host machine.
* If you just wish to :ref:`run the tests <running-tests>`, you can stop now without performing the remaining steps below.

Просмотреть файл

@ -59,8 +59,8 @@ class python {
}
exec {"activate-venv-on-login":
unless => "grep 'source venv/bin/activate' ${HOME_DIR}/.bashrc",
command => "echo 'source venv/bin/activate' >> ${HOME_DIR}/.bashrc",
unless => "grep 'source ${VENV_DIR}/bin/activate' ${HOME_DIR}/.bashrc",
command => "echo 'source ${VENV_DIR}/bin/activate' >> ${HOME_DIR}/.bashrc",
require => Exec["create-virtualenv"],
user => "${APP_USER}",
}

Просмотреть файл

@ -14,6 +14,12 @@ class treeherder {
require => Package['memcached'],
}
exec {"cd-treeherder-on-login":
unless => "grep 'cd ${PROJ_DIR}' ${HOME_DIR}/.bashrc",
command => "echo 'cd ${PROJ_DIR}' >> ${HOME_DIR}/.bashrc",
user => "${APP_USER}",
}
exec{"build-extensions":
command => "${VENV_DIR}/bin/python ${PROJ_DIR}/setup.py build_ext --inplace",
user => "${APP_USER}",