Skip to content

Commit

Permalink
appropriately handle the bool, undo change to common
Browse files Browse the repository at this point in the history
  • Loading branch information
scbedd committed Oct 5, 2020
1 parent 4bd9276 commit 0495246
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ steps:
- pwsh: |
$setDailyDevBuild = "false"
if (('$(Build.Reason)' -eq 'Schedule') -and ('$(System.TeamProject)' -eq 'internal')) {
$setDailyDevBuild = "True"
$setDailyDevBuild = "true"
}
echo "##vso[task.setvariable variable=SetDevVersion]$setDailyDevBuild"
displayName: "Setup Versioning Properties"
Expand Down
21 changes: 17 additions & 4 deletions scripts/devops_tasks/build_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@
sys.path.append(tox_path)
from sanitize_setup import process_requires

def build_packages(targeted_packages, distribution_directory, is_dev_build = False):

def str_to_bool(input_string):
if isinstance(input_string, bool):
return input_string
if input_string.lower() in ("true", "t", "1"):
return True
elif input_string.lower() in ("false", "f", "0"):
return False


def build_packages(targeted_packages, distribution_directory, is_dev_build=False):
# run the build and distribution
for package_root in targeted_packages:
print(package_root)
Expand Down Expand Up @@ -93,7 +103,6 @@ def verify_update_package_requirement(pkg_root):
),
)


args = parser.parse_args()

# We need to support both CI builds of everything and individual service
Expand All @@ -104,5 +113,9 @@ def verify_update_package_requirement(pkg_root):
else:
target_dir = root_dir

targeted_packages = process_glob_string(args.glob_string, target_dir, args.package_filter_string)
build_packages(targeted_packages, args.distribution_directory, args.is_dev_build)
targeted_packages = process_glob_string(
args.glob_string, target_dir, args.package_filter_string
)
build_packages(
targeted_packages, args.distribution_directory, str_to_bool(args.is_dev_build)
)

0 comments on commit 0495246

Please sign in to comment.