forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build package + deploy to Travis
- Loading branch information
Showing
3 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env python | ||
|
||
#------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
#-------------------------------------------------------------------------- | ||
|
||
import os | ||
import sys | ||
import re | ||
from pathlib import Path | ||
from build_package import create_package | ||
|
||
travis_tag = os.environ.get('TRAVIS_TAG') | ||
if not travis_tag: | ||
print("TRAVIS_TAG environment variable is not present") | ||
sys.exit() | ||
|
||
matching = re.match(r"^(?P<name>azure[a-z\-]*) (?P<version>[.0-9]+[rc0-9]*)$", travis_tag) | ||
if not matching: | ||
print("TRAVIS_TAG is not '<package_name> <version>'") | ||
sys.exit() | ||
|
||
name, version = matching.groups() | ||
create_package(name, '../dist') | ||
|
||
print("Produced:\n{}".format(list(Path('./dist').glob('*')))) | ||
|
||
pattern = "*{}*".format(version) | ||
packages = list(Path('./dist').glob(pattern)) | ||
if not packages: | ||
sys.exit("Package version does not match tag {}, abort".format(version)) | ||
else: | ||
print("Package created as expected") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters