question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Env variables placeholder, initialisation scripts and orders

See original GitHub issue

I 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:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
davidfowlcommented, May 21, 2020
0reactions
mustakimalicommented, May 20, 2020

Of course with an initialisation script and the ability to define order, I can map these environment variables using a bash script myself.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found