Skip to content

Commit 2021a44

Browse files
authored
Allow passing custom env vars to Chainlink Node containers (#1890)
1 parent 6e384b2 commit 2021a44

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

book/src/framework/components/chainlink/node.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ Here we provide full configuration reference, if you want to copy and run it, pl
4747
mySecret = 'a'
4848
"""
4949

50+
[cl_node.node.env_vars]
51+
MY_FIRST_ENV_VAR = "env var value"
52+
5053
# Outputs are the results of deploying a component that can be used by another component
5154
[cl_node.out]
5255
# If 'use_cache' equals 'true' we skip component setup when we run the test and return the outputs

framework/.changeset/v0.9.3.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Allow passing custom env vars to Chainlink Node containers

framework/components/clnode/clnode.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ type NodeInput struct {
6161
CustomPorts []string `toml:"custom_ports"`
6262
DebuggerPort int `toml:"debugger_port"`
6363
ContainerResources *framework.ContainerResources `toml:"resources"`
64+
EnvVars map[string]string `toml:"env_vars"`
6465
}
6566

6667
// Output represents Chainlink node output, nodes and databases connection URLs
@@ -245,6 +246,7 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
245246
NetworkAliases: map[string][]string{
246247
framework.DefaultNetworkName: {containerName},
247248
},
249+
Env: in.Node.EnvVars,
248250
ExposedPorts: exposedPorts,
249251
Entrypoint: generateEntryPoint(),
250252
WaitingFor: wait.ForHTTP("/").

framework/components/simple_node_set/node_set.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ func sharedDBSetup(in *Input, bcOut *blockchain.Output) (*Output, error) {
155155
TestSecretsOverrides: in.NodeSpecs[overrideIdx].Node.TestSecretsOverrides,
156156
UserSecretsOverrides: in.NodeSpecs[overrideIdx].Node.UserSecretsOverrides,
157157
ContainerResources: in.NodeSpecs[overrideIdx].Node.ContainerResources,
158+
EnvVars: in.NodeSpecs[overrideIdx].Node.EnvVars,
158159
},
159160
}
160161

0 commit comments

Comments
 (0)