* Update azure-pipelines.yml for Azure Pipelines * Add Python build scripts. * Run scripts with Python 3. * Add strategy for both variants. * Fix variables for jobs and use the right variant to build. * Fix build and test script.
40 lines
684 B
Python
40 lines
684 B
Python
#!/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)
|