forked from maxking/docker-mailman
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
39 lines (27 loc) · 684 Bytes
/
test.py
File metadata and controls
39 lines (27 loc) · 684 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python3
import sys
from pathlib import Path
from build import VARIANTS
DOCKER_TEST="""version: '2'
services:
mailman-core:
image: core-{variant}
mailman-web:
image: web-{variant}
environment:
- SECRET_KEY=abcdefghijklmnopqrstuv
"""
def test_setup(variant):
Path('docker-test.yaml').write_text(
DOCKER_TEST.format(variant=variant))
def usage():
print('usage: python test.py (stable|rolling)')
if __name__ == '__main__':
if len(sys.argv) < 2:
usage()
sys.exit(1)
variant = sys.argv[1]
if variant not in VARIANTS:
usage()
sys.exit(1)
test_setup(variant)