Env variables placeholder, initialisation scripts and orders
See original GitHub issueI was assessing the suitability of tye
in a project and I have few questions that I don’t know if they are possible.
1. Can we use placeholders in environment variable
consider following scheme, I want to pass the port of app2
into app1
as an environment variable.
name: tye-them-all
services:
- name: app1
project: src/app1/app1.csproj
env:
- name: APP2_BASE_URL
value: "http://localhost:{app2_port}/"
- name: app2
project: src/app2/app2.csproj
bindings:
- autoAssignPort: true
2. Run initialisation scripts for projects and containers
We may need to run some initialisation scripts that run after a container/project is running.
name: tye-them-all
services:
- name: app1
project: src/app1/app1.csproj
# script should have access to ${postgres_port} env variable
init_script: scripts/init-db.sh
- name: postgres
image: postgres
bindings:
- autoAssignPort: true
3. Define orders
The previous suggestion will work better if we can define the order or dependencies between services.
name: tye-them-all
services:
- name: app1
project: src/app1/app1.csproj
# script should have access to ${postgres_port} env variable
init_script: scripts/init-db.sh
requires: ["postgres"]
- name: postgres
image: postgres
bindings:
- autoAssignPort: true
Thank you for your help. 👍
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Set and use environment variables with init scripts
Init scripts have access to all environment variables present on a cluster. Databricks sets many default variables that can be useful in init...
Read more >Define Dependent Environment Variables
This page shows how to define dependent environment variables for a container in a Kubernetes Pod. ... Note that order matters in the...
Read more >Create user environment variable with expandable value
I can create a user environment variable within a Powershell script (Windows 10) easily. [System.Environment]::SetEnvironmentVariable('name', ' ...
Read more >Set a predefined list of values for CI environment variables ...
In this release we've added the ability to set a list of predefined variable values for CI environment variables to make it easier...
Read more >Environment properties and other software settings
Configuring environment properties (environment variables) · Open the Elastic Beanstalk console , and in the Regions list, select your AWS Region. · In...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
See https://github.com/dotnet/tye/issues/377 for 1.
Of course with an initialisation script and the ability to define order, I can map these environment variables using a
bash
script myself.