diff --git a/scripts/buildkite/sample_build.py b/scripts/buildkite/sample_build.py index 1ab1c4e..bb9c42e 100644 --- a/scripts/buildkite/sample_build.py +++ b/scripts/buildkite/sample_build.py @@ -2,15 +2,18 @@ import os import json import argparse import requests +import time if __name__ == '__main__': parser = argparse.ArgumentParser(description='Run sample build on buildkite.') parser.add_argument('--dryrun', action='store_true') + parser.add_argument('--commit') + pipeline='upstream-bazel-test' args = parser.parse_args() - + time.sleep(2) d = json.dumps({ 'branch': 'main', - 'commit': '43b38696aa038a83b12850aab25377650e301cde', + 'commit': args.commit, 'env': { 'ph_log_level': 'DEBUG', #'ph_skip_linux': 'skip', @@ -34,7 +37,7 @@ if __name__ == '__main__': exit(1) print(f"token {token}") - re = requests.post('https://api.buildkite.com/v2/organizations/llvm-project/pipelines/llvm-main/builds', + re = requests.post(f'https://api.buildkite.com/v2/organizations/llvm-project/pipelines/{pipeline}/builds', data=d, headers={'Authorization': f'Bearer {token}'}) print(re.status_code) diff --git a/setup_k8s.sh b/setup_k8s.sh new file mode 100755 index 0000000..53b81ac --- /dev/null +++ b/setup_k8s.sh @@ -0,0 +1,10 @@ +# Setups kubernetes with env variables. + +echo GCP_PROJECT=$GCP_PROJECT +echo GCP_ZONE=$GCP_ZONE +echo GCP_CLUSTER=$GCP_CLUSTER +gcloud config set project ${GCP_PROJECT} +gcloud config set compute/zone ${GCP_ZONE} +# setup docker for pushing containers +gcloud auth configure-docker +gcloud container clusters get-credentials $GCP_CLUSTER \ No newline at end of file