Update azure-pipelines.yml for Azure Pipelines (#331)
* 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.
This commit is contained in:
39
test.py
Normal file
39
test.py
Normal file
@@ -0,0 +1,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)
|
||||
Reference in New Issue
Block a user