Only do on PR

This commit is contained in:
Dominic Oram
2019-10-11 18:38:05 +01:00
parent adff4d92d3
commit 81b5d1f1dc
2 changed files with 5 additions and 7 deletions

View File

@@ -1,11 +1,10 @@
image: python:3.7.3
options:
max-time: 1
pipelines:
custom:
check_version:
pull-requests:
- step:
caches:
- pip
script:
- git submodule update --init
- python pipeline.py
- python twincat_version_manager.py

View File

@@ -1,6 +1,5 @@
import glob
import xml.etree.ElementTree as ET
import os
VERSION_TAGS = {"**/*.Tc*": "ProductVersion", "**/*.tsproj": "TcVersion"}
CORRECT_VERSION = "3.1.4024.0"
@@ -33,4 +32,4 @@ if __name__ == "__main__":
incorrect_files = check_versions()
for file, version in incorrect_files.items():
print("ERROR: {} has incorrect version {}, expected version {}".format(file, version, CORRECT_VERSION))
exit(0) # Exit with non-zero if any bad versions were found
exit(len(incorrect_files)) # Exit with non-zero if any bad versions were found