scripts: setup k8s from env + commit arg for bk
This commit is contained in:
parent
a725f9ea89
commit
377ea890b8
2 changed files with 16 additions and 3 deletions
|
@ -2,15 +2,18 @@ import os
|
||||||
import json
|
import json
|
||||||
import argparse
|
import argparse
|
||||||
import requests
|
import requests
|
||||||
|
import time
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Run sample build on buildkite.')
|
parser = argparse.ArgumentParser(description='Run sample build on buildkite.')
|
||||||
parser.add_argument('--dryrun', action='store_true')
|
parser.add_argument('--dryrun', action='store_true')
|
||||||
|
parser.add_argument('--commit')
|
||||||
|
pipeline='upstream-bazel-test'
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
time.sleep(2)
|
||||||
d = json.dumps({
|
d = json.dumps({
|
||||||
'branch': 'main',
|
'branch': 'main',
|
||||||
'commit': '43b38696aa038a83b12850aab25377650e301cde',
|
'commit': args.commit,
|
||||||
'env': {
|
'env': {
|
||||||
'ph_log_level': 'DEBUG',
|
'ph_log_level': 'DEBUG',
|
||||||
#'ph_skip_linux': 'skip',
|
#'ph_skip_linux': 'skip',
|
||||||
|
@ -34,7 +37,7 @@ if __name__ == '__main__':
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
print(f"token {token}")
|
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,
|
data=d,
|
||||||
headers={'Authorization': f'Bearer {token}'})
|
headers={'Authorization': f'Bearer {token}'})
|
||||||
print(re.status_code)
|
print(re.status_code)
|
||||||
|
|
10
setup_k8s.sh
Executable file
10
setup_k8s.sh
Executable file
|
@ -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
|
Loading…
Reference in a new issue