Instructions for environment variables.
parent
280fa5867c
commit
471aca4587
54
README.md
54
README.md
|
@ -2,19 +2,47 @@
|
|||
|
||||
All analysis for the STRAW project.
|
||||
|
||||
To install first:
|
||||
To install:
|
||||
|
||||
* Create a conda virtual environment from the `environment.yml` file.
|
||||
1. Create a conda virtual environment from the `environment.yml` file.
|
||||
|
||||
```shell
|
||||
cd config
|
||||
conda env create --file environment.yml
|
||||
conda activate straw2analysis
|
||||
```
|
||||
If you have already created this environment, you can update it using:
|
||||
```shell
|
||||
cd config
|
||||
conda env create --file environment.yml
|
||||
conda activate straw2analysis
|
||||
```
|
||||
|
||||
```shell
|
||||
conda deactivate
|
||||
conda env update --file environment.yml
|
||||
conda activate straw2analysis
|
||||
```
|
||||
If you have already created this environment, you can update it using:
|
||||
|
||||
```shell
|
||||
conda deactivate
|
||||
conda env update --file environment.yml
|
||||
conda activate straw2analysis
|
||||
```
|
||||
|
||||
2. Follow [the instructions](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#saving-environment-variables) to set DB_PASSWORD as the environment variable.
|
||||
|
||||
In short, use:
|
||||
|
||||
```shell
|
||||
cd $CONDA_PREFIX
|
||||
mkdir -p ./etc/conda/activate.d
|
||||
mkdir -p ./etc/conda/deactivate.d
|
||||
touch ./etc/conda/activate.d/env_vars.sh
|
||||
touch ./etc/conda/deactivate.d/env_vars.sh
|
||||
```
|
||||
and then edit `./etc/conda/activate.d/env_vars.sh` as follows:
|
||||
|
||||
```bash
|
||||
#!/bin/sh
|
||||
|
||||
export DB_PASSWORD='database-password'
|
||||
```
|
||||
|
||||
and `./etc/conda/deactivate.d/env_vars.sh` as follows:
|
||||
|
||||
```bash
|
||||
#!/bin/sh
|
||||
|
||||
unset DB_PASSWORD
|
||||
```
|
Loading…
Reference in New Issue