Description
I noticed that if I edited the name of "mongodb-replicaset" job in containerpilot.json5
, the manage.py
script would break because the job name is hard coded.
Therefore, I was thinking it would be good to extract that bit out into a global variable. In fact, we could simply use the REPLICASET
variable, having it default to "mongodb-replicaset".
manage.py
Lines 75 to 76 in 23f6c30
PRIMARY = get_environ('REPLICASET', 'mongodb-replicaset')
#SECONDARY = get_environ('REPLICASET_SECONDARY', 'mongodb-secondary')
containerpilot.json5
mongodb/etc/containerpilot.json5
Line 30 in 23f6c30
name: "{{ .REPLICASET | default "mongodb-replicaset" }}",
mongodb/etc/containerpilot.json5
Line 32 in 23f6c30
exec: "mongod --replSet={{ .REPLICASET | default "mongodb-replicaset" }}",
mongodb/etc/containerpilot.json5
Line 44 in 23f6c30
name: "onchange-{{ .REPLICASET | default "mongodb-replicaset" }}",
mongodb/etc/containerpilot.json5
Line 47 in 23f6c30
source: "watch.{{ .REPLICASET | default "mongodb-replicaset" }}",
mongodb/etc/containerpilot.json5
Lines 52 to 57 in 23f6c30
watches: [
{
name: "{{ .REPLICASET | default "mongodb-replicaset" }}",
interval: 2
}
]
local-compose.yml
mongo:
environment:
REPLICASET=awesome-replicaset
Naming conventions:
--replSet
doesn't say anything about name restrictions, and the containerpilot job name
is adequately restrictive, so would follow the containerpilot name
rules.