Skip to content

Instantly share code, notes, and snippets.

@cppforlife
Forked from strophy/config.yml
Last active January 25, 2020 00:29
Show Gist options
  • Save cppforlife/dd186d8993b045f15dffc6b42f4ea3d9 to your computer and use it in GitHub Desktop.
Save cppforlife/dd186d8993b045f15dffc6b42f4ea3d9 to your computer and use it in GitHub Desktop.
ytt docker-dash configuration templating
#@data/values
---
network: testnet
#@ load("@ytt:data", "data")
#@ load("misc.star", "indexed_item")
---
version: '3'
services:
dashd:
#@ img_dashd = indexed_item(data.values.images.dashd, data.values.network)
image: #@ img_dashd.image
command: /bin/bash -c 'dashd -conf=/dash/dash.conf'
restart: always
volumes:
- dash.conf:/dash/dash.conf
- dashd_data:/dash
ports:
#@ port_dashd = indexed_item(data.values.ports.dashd, data.values.network)
- #@ port_dashd.p2p + ":" + port_dashd.p2p
sentinel:
image: #@ getattr(data.values.images.sentinel, data.values.network).image
volumes:
dashd_data:
#@data/values
---
#@overlay/match missing_ok=True
images:
dashd:
- network: evonet
image: dashpay/dashd:0.14.0.5
- network: testnet
image: dashpay/dashd-develop:latest
- network: mainnet
image: dashpay/dashd:0.14.0.5
sentinel:
evonet:
image: strophy/sentinel:latest
testnet:
image: strophy/sentinel:latest
mainnet:
image: strophy/sentinel:latest
load("@ytt:assert", "assert")
def indexed_item(list, network):
for item in list:
if item.network == network:
return item
end
end
assert.fail("Expected to find item with network but did not")
end
#@data/values
---
#@overlay/match missing_ok=True
ports:
dashd:
- network: mainnet
p2p: "9999"
rpc: "9998"
zmq: "9997"
- network: testnet
p2p: "19999"
rpc: "19998"
zmq: "19997"
- network: evonet
p2p: "20001"
rpc: "20002"
zmq: "20003"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment