Created
February 20, 2020 01:17
-
-
Save jlisee/7e43a33c4e7a362d5852f20e148b9e27 to your computer and use it in GitHub Desktop.
build_both_flows.py
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
from atg.buildkite.cli import BuildkiteCli | |
from atg.buildkite.environment import is_buildkite_build | |
from atg.devex.ci import execution_environment | |
from atg.devex.ci.buildkite.log import print_separator | |
from atg.devex.ci.changedtargets import ( | |
JSON_TARGET_FILENAME, | |
BAZEL_PROTOBUF_FILENAME, | |
changed_targets_report, | |
determine_changed_targets, | |
dump_all_targets, | |
) | |
def builditall(): | |
pass | |
def main(): | |
# Paths where to store things | |
# Determine where to run | |
print_separator("Determine git commit range") | |
commit_range = execution_environment.commit_range() | |
print(commit_range.description()) | |
# Compute the targets | |
if builditall(): | |
print_separator("#buildkitall detected - getting all targets") | |
dump_all_targets(target_output=JSON_TARGET_FILENAME, | |
bazel_protobuf=BAZEL_PROTOBUF_FILENAME) | |
else: | |
determine_changed_targets(target_output=JSON_TARGET_FILENAME, | |
bazel_protobuf=BAZEL_PROTOBUF_FILENAME) | |
# Print report on file | |
print_separator("All changed targets") | |
print(changed_targets_report(JSON_TARGET_FILENAME)) | |
# Upload the result files | |
if is_buildkite_build(): | |
print_separator("Uploading targets and data") | |
BuildkiteCli.upload_artifact(JSON_TARGET_FILENAME) | |
BuildkiteCli.upload_artifact(BAZEL_PROTOBUF_FILENAME) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment