Deploy Environment Variables
Applications can run in different configurations in various projects. For example, an application can work in two different projects with different default languages. For such requirements, the Environment Parameters feature of Akinon Commerce Cloud is used. These parameters can be seen in the ENV Variables
column when listing applications.
$ akinoncli projectapp add-env --deploy {project_id} {project_app_id} {ENV_KEY}={ENV_VALUE} {ANOTHER_ENV_KEY}={ANOTHER_ENV_VALUE}
Environment Parameters
Adds the environment parameter on the application.
Parameter | Description | Required |
---|---|---|
project_id | Project ID | Yes |
project_app_id | Application ID | Yes |
ENV_KEY | The key of relevant environment parameter | Yes |
ENV_VALUE | The value of relevant environment parameter | Yes |
--deploy | Deploys the current version to enable environment variables will be changed. | No |
Example 1
$ akinoncli projectapp add-env 1 32 DEFAULT_LANG=TR_TR --deploy
It is also can be used with JSON
Example 2
$ akinoncli projectapp add-env 1 32 MIDDLEWARE='["my.custom.MiddlewareClass", "django.middleware.security.SecurityMiddleware", "whitenoise.middleware.WhiteNoiseMiddleware", "django.contrib.sessions.middleware.SessionMiddleware"]'
Example 3
$ akinoncli projectapp add-env 1 32 THUMBNAIL_OPTIONS='{"product-list": {"width": 273, "height": 210}, "product-detail__slider_zoom": {"quality": 90}}'