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:
Abhilash Raj
2019-05-19 21:02:06 -04:00
committed by GitHub
parent 234f62241a
commit e6de13ba44
4 changed files with 153 additions and 15 deletions

39
test.py Normal file
View 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)