Skip to content

Doc add environment variable - #867

Merged
eldadfux merged 7 commits into
appwrite:0.7.xfrom
lohanidamodar:doc-add-environment-variable
Feb 9, 2021
Merged

eldadfux merged 7 commits into
appwrite:0.7.xfrom
lohanidamodar:doc-add-environment-variable

Conversation

@lohanidamodar

Copy link
Copy Markdown
Member

What does this PR do?

New doc for adding Environment variables

Test Plan

N/A

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

YES

@eldadfux
eldadfux changed the base branch from master to 0.7.x February 1, 2021 09:32
This tutorial will cover, how to properly add new environment variable in Appwrite.

### Naming environment varialbe
The environment variables in Appwrite is prefixed with `_APP_`. Then if it belongs to specific cateogry, the category name is appended as `_APP_REDIS` for redis category. Finally the properly describing name is given to the variable as `_APP_REDIS_HOST` for redis host.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention list of categories is available at https://appwrite.io/docs/environment-variables

Comment thread docs/tutorials/add-environment-variable.md
First of all we add the new environment variable to `app/config/variables.php` under specific category. If none of the categories fit, add it in general category. Copy the existing variables description to create new one so that you will not miss any required fields.

### Add to .env and Dockerfile
If newly introduced environment variable has a default value, add it to the `.env` and `Dockerfile` along with other environment variables.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a note that we use the .env file as setting for the Appwrite development environment.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still pending

Comment thread docs/tutorials/add-environment-variable.md

If everything goes well, commit and initiate a PR and wait for the Appwrite team's approval.

Whooho! you have successfully added new environment variable to Appwrite. No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires a celebration emoji!! 😉

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The more emojis the better hehe

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehe I mean inside the tutorial, make it happier add emojis 😃

### Agenda
Adding new features may require various configurations options to be set by the users. And for such options we use environment variables in Appwrite.

This tutorial will cover, how to properly add new environment variable in Appwrite.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a new environment *

This tutorial will cover, how to properly add new environment variable in Appwrite.

### Naming environment varialbe
The environment variables in Appwrite is prefixed with `_APP_`. Then if it belongs to specific cateogry, the category name is appended as `_APP_REDIS` for redis category. The available categories are General, Redis, MariaDB, InfluxDB, StatsD, SMTP, Storage and Functions. Finally the properly describing name is given to the variable as `_APP_REDIS_HOST` for redis host. You can find more information on available categories and existing environment variables at [environment variables doc](https://appwrite.io/docs/environment-variables).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in Appwrite are *

Then if it belongs <- remove the Then

to a specific cateogry *

for the Redis category *

Comment thread docs/tutorials/add-environment-variable.md
The environment variables in Appwrite is prefixed with `_APP_`. Then if it belongs to specific cateogry, the category name is appended as `_APP_REDIS` for redis category. The available categories are General, Redis, MariaDB, InfluxDB, StatsD, SMTP, Storage and Functions. Finally the properly describing name is given to the variable as `_APP_REDIS_HOST` for redis host. You can find more information on available categories and existing environment variables at [environment variables doc](https://appwrite.io/docs/environment-variables).

### Describe new environment variable
First of all we add the new environment variable to `app/config/variables.php` under specific category. If none of the categories fit, add it in general category. Copy the existing variables description to create new one so that you will not miss any required fields.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all, we *

in the designated category. *

add it to the General category *

Copy the existing variables description to create a new one, so that you will not miss any required fields. *


The `docker-compose.yml` file is used by the Appwrite maintainers during development where as `app/views/install/compose.phtml` file is used by the Appwrite setup script.

With these steps, your environment variable is properly added and can be accessed inside Appwrite code or any other containers where it is passed. You can access and use those variables to implement the features you are trying to implement.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accessed inside Appwrite code and any other containers *

You can access and use those variables to implement the features you are trying to achieve. *


With these steps, your environment variable is properly added and can be accessed inside Appwrite code or any other containers where it is passed. You can access and use those variables to implement the features you are trying to implement.

If everything goes well, commit and initiate a PR and wait for the Appwrite team's approval.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If everything went well *

@lohanidamodar

Copy link
Copy Markdown
Member Author

@eldadfux I believe this is ready too!

Comment thread docs/tutorials/add-environment-variable.md Outdated
Comment thread docs/tutorials/add-environment-variable.md Outdated

@christyjacob4 christyjacob4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 😄

@eldadfux
eldadfux merged commit 60af368 into appwrite:0.7.x Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants