Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another attempt to fix periodic jobs. #77

Merged
merged 1 commit into from
Oct 24, 2017
Merged
Changes from all commits
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
17 changes: 12 additions & 5 deletions test-infra/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,20 @@ def get_gcs_output():
job=job_name,
build=os.getenv("BUILD_NUMBER"))
return output
else:
# It is a periodic or postsubmit job
elif os.getenv("REPO_OWNER"):
# It is a postsubmit job
output = ("gs://kubernetes-jenkins/logs/{owner}_{repo}/"
"{job}/{build}").format(
owner=GO_REPO_OWNER, repo=GO_REPO_NAME,
pull_number=pull_number,
job=job_name,
build=os.getenv("BUILD_NUMBER"))
return output

else:
# Its a periodic job
output = ("gs://kubernetes-jenkins/logs/{job}/{build}").format(
job=job_name,
build=os.getenv("BUILD_NUMBER"))
return output

def create_started(gcs_client, output_dir, sha):
"""Create the started output in GCS.
Expand All @@ -277,13 +281,16 @@ def create_started(gcs_client, output_dir, sha):
# For a list of fields expected by gubernator
started = {
"timestamp": int(time.time()),
"pull": os.getenv("PULL_REFS", ""),
"repos": {
# List all repos used and their versions.
GO_REPO_OWNER + "/" + GO_REPO_NAME: sha,
},
}

PULL_REFS = os.getenv("PULL_REFS", "")
if started:
started["pull"] = PULL_REFS

m = GCS_REGEX.match(output_dir)
bucket = m.group(1)
path = m.group(2)
Expand Down