зеркало из https://github.com/mozilla/treeherder.git
Bug 1056865 - Add support for custom env file in Vagrant that is ignored by git (#4857)
This commit is contained in:
Родитель
16b844079a
Коммит
3267f191bb
|
@ -5,6 +5,7 @@ node_modules/
|
|||
.vscode/
|
||||
yarn-error.log
|
||||
npm-error.log
|
||||
vagrant/env_local.sh
|
||||
|
||||
# vi
|
||||
*.swp
|
||||
|
|
|
@ -127,6 +127,21 @@ To get started:
|
|||
- If you just wish to [run the tests](common_tasks.md#running-the-tests),
|
||||
you can stop now without performing the remaining steps.
|
||||
|
||||
### Customizing Vagrant
|
||||
|
||||
If you have some common settings you make in Vagrant (setting an alternate database, or your own
|
||||
pulse credentials, etc) then you can create a file that contains `alias`es and `function`s
|
||||
to setup those values in a file called `vagrant/env_local.sh`. Git will ignore this file and
|
||||
not check it in with your changes.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! warning
|
||||
We highly recommend you do NOT ``export`` any values in this file, as it is a foot-gun.
|
||||
If This could lead to a situation where one forgets certain settings were made in that file, and
|
||||
is getting unexpected results in Vagrant. These changes will persist, event after a
|
||||
``vagrant destroy``. For this reason, only use ``alias`` and ``function`` entries, and execute
|
||||
them when you need them.
|
||||
|
||||
### Starting a local Treeherder instance
|
||||
|
||||
- Start a Django runserver instance inside the Vagrant VM, to serve the static UI and API requests:
|
||||
|
|
|
@ -8,6 +8,11 @@
|
|||
> vagrant provision
|
||||
```
|
||||
|
||||
Check if you have a file `/vagrant/env_local.sh`. If this file has any errors or is explicitly
|
||||
exporting any environment variables, we recommend updating it so it only has entries of `alias`
|
||||
and `function`.
|
||||
See [Customizing Vagrant](installation.md#customizing-vagrant)
|
||||
|
||||
If that is still unsuccessful, you should attempt a `vagrant destroy` followed by another `vagrant up --provision`.
|
||||
|
||||
- If you encounter an error saying _"mount.nfs: requested NFS version or transport protocol is not supported"_, you should restart the kernel server service using this sequence of commands:
|
||||
|
|
|
@ -40,6 +40,11 @@ ln -sf "$SRC_DIR/vagrant/.profile" "$HOME/.profile"
|
|||
sudo ln -sf "$SRC_DIR/vagrant/env.sh" /etc/profile.d/treeherder.sh
|
||||
. vagrant/env.sh
|
||||
|
||||
if [[ -f vagrant/env_local.sh ]]; then
|
||||
echo '-----> Found custom local_env.sh'
|
||||
sudo ln -sf "$SRC_DIR/vagrant/env_local.sh" /etc/profile.d/treeherder_local.sh
|
||||
fi
|
||||
|
||||
if ! grep -qs 'node_11.x' /etc/apt/sources.list.d/nodesource.list; then
|
||||
echo '-----> Adding APT repository for Node.js'
|
||||
sudo curl -sSf https://deb.nodesource.com/gpgkey/nodesource.gpg.key -o /etc/apt/trusted.gpg.d/nodesource.asc
|
||||
|
|
Загрузка…
Ссылка в новой задаче