Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updating build-artifacts to generate python2 nspkgs if any exist
  • Loading branch information
scbedd committed Sep 12, 2019
commit ebaebf07bcdc713451b6ad0c7595a2330057d555
15 changes: 15 additions & 0 deletions eng/pipelines/templates/steps/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ steps:
displayName: 'Tag scheduled builds'
condition: and(eq(variables['Build.SourceBranchName'],'master'),eq(variables['Build.Reason'],'Schedule'))

- task: UsePythonVersion@0
displayName: 'Use Python 2.7'
inputs:
versionSpec: '2.7'

- script: |
pip install wheel setuptools packaging
displayName: 'Prep Environment'

- task: PythonScript@0
displayName: 'Generate Python2 Applicable Namespace Packages'
inputs:
scriptPath: 'scripts/devops_tasks/build_packages.py'
arguments: '-d "$(Build.ArtifactStagingDirectory)" "${{ parameters.BuildTargetingString }}" --service=${{parameters.ServiceDirectory}} --additionalfilterstring=nspkg'

- task: UsePythonVersion@0
displayName: 'Use Python $(PythonVersion)'
inputs:
Expand Down
10 changes: 9 additions & 1 deletion scripts/devops_tasks/build_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ def build_packages(targeted_packages, distribution_directory):
),
)

parser.add_argument(
"--additionalfilterstring",
help=(
"Additional filter on top of the glob_string already presented. Used in simple 'contains' match"
"Example: --additionalfilterstring=nspkg"
),
)

args = parser.parse_args()

# We need to support both CI builds of everything and individual service
Expand All @@ -75,5 +83,5 @@ def build_packages(targeted_packages, distribution_directory):
else:
target_dir = root_dir

targeted_packages = process_glob_string(args.glob_string, target_dir)
targeted_packages = process_glob_string(args.glob_string, target_dir, args.additionalfilterstring)
build_packages(targeted_packages, args.distribution_directory)
6 changes: 3 additions & 3 deletions scripts/devops_tasks/common_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def filter_for_compatibility(package_set):
# this function is where a glob string gets translated to a list of packages
# It is called by both BUILD (package) and TEST. In the future, this function will be the central location
# for handling targeting of release packages
def process_glob_string(glob_string, target_root_dir):
def process_glob_string(glob_string, target_root_dir, additional_filter_string=""):
if glob_string:
individual_globs = glob_string.split(",")
else:
Expand All @@ -145,8 +145,8 @@ def process_glob_string(glob_string, target_root_dir):
collected_top_level_directories.extend([os.path.dirname(p) for p in globbed])

# dedup, in case we have double coverage from the glob strings. Example: "azure-mgmt-keyvault,azure-mgmt-*"
collected_directories = list(set(collected_top_level_directories))

collected_directories = [p for p in list(set(collected_top_level_directories)) if additional_filter_string in p]
# if we have individually queued this specific package, it's obvious that we want to build it specifically
# in this case, do not honor the omission list
if len(collected_directories) == 1:
Expand Down