Merge pull request #45 from GNS3/travis-validate-gns3server

Travis validate gns3server, Ref. #37, #39
This commit is contained in:
ziajka 2018-01-18 09:44:57 +01:00 committed by GitHub
commit d38eecd27f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 17 deletions

View File

@ -17,7 +17,7 @@ build_script:
- yarn buildforelectron - yarn buildforelectron
- "%PYTHON%\\python.exe -m pip install -r scripts\\requirements.txt" - "%PYTHON%\\python.exe -m pip install -r scripts\\requirements.txt"
- "%PYTHON%\\python.exe scripts\\build.py download" - "%PYTHON%\\python.exe scripts\\build.py download"
- "%PYTHON%\\python.exe scripts\\build.py build -b dist" - "%PYTHON%\\python.exe scripts\\build.py build_exe -b dist/exe.gns3server -s"
- "%PYTHON%\\python.exe scripts\\build.py validate -b dist" - "%PYTHON%\\python.exe scripts\\build.py validate -b dist"
- yarn electron-builder --win --x64 - yarn electron-builder --win --x64

View File

@ -37,7 +37,7 @@ jobs:
brew install python3 brew install python3
pip3 install -r scripts/requirements.txt pip3 install -r scripts/requirements.txt
python3 scripts/build.py download python3 scripts/build.py download
python3 scripts/build.py build -b dist python3 scripts/build.py build_exe -b dist/exe.gns3server -s
python3 scripts/build.py validate -b dist python3 scripts/build.py validate -b dist
- run: - run:

View File

@ -54,9 +54,8 @@ after_script:
- yarn buildforelectron - yarn buildforelectron
- python3 -m venv env - python3 -m venv env
- | - |
source env/bin/activate
pip3 install -r scripts/requirements.txt pip3 install -r scripts/requirements.txt
python3 scripts/build.py download python3 scripts/build.py download
python3 scripts/build.py build -b dist python3 scripts/build.py build_exe -b dist/exe.gns3server -s
# python3 scripts/build.py validate -b dist python3 scripts/build.py validate -b dist
- yarn electron-builder --linux --x64 - yarn electron-builder --linux --x64

View File

@ -229,24 +229,24 @@ def validate_command(arguments):
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description='Building gns3server for distribution') description='Building gns3server for distribution')
subparsers = parser.add_subparsers( subparsers = parser.add_subparsers(
dest='command', dest='command', help='Command which needs to be executed')
help="Command which needs to be executed")
download_parser = subparsers.add_parser( parser_download = subparsers.add_parser(
'download', help="Downloads source code of gns3server") 'download', help='Downloads source code of gns3server')
build_parser = subparsers.add_parser( parser_build = subparsers.add_parser('build_exe', help='Build gns3server')
'build', help="Build gns3server") parser_build.add_argument('-b', help='Output directory')
build_parser.add_argument('-b', default=None, help="Output directory") parser_build.add_argument('-s', action='store_true', help='Silient building')
validate_parser = subparsers.add_parser( parser_validate = subparsers.add_parser('validate', help='Validate build')
'validate', help="Validate build") parser_validate.add_argument('-b', help='Output directory')
validate_parser.add_argument('-b', default=None, help="Output directory")
args = parser.parse_args() args = parser.parse_args()
if args.command == 'build':
if args.command == 'build_exe':
prepare() prepare()
build_command(args) build_command(args)
elif args.command == 'download': elif args.command == 'download':