forked from kubernetes/test-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.yaml
65 lines (63 loc) · 2.99 KB
/
global.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
- builder:
name: activate-gce-service-account
builders:
- shell: |
export HOME="${WORKSPACE}"
export CLOUDSDK_CONFIG="${WORKSPACE}/.config/gcloud"
gcloud auth activate-service-account --key-file="${GOOGLE_APPLICATION_CREDENTIALS}"
- builder:
name: ensure-upload-to-gcs-script
git-basedir: ''
builders:
- shell: |
_script_tmp_path="${{WORKSPACE}}/_tmp/upload-to-gcs.sh"
_script_repo_path="hack/jenkins/upload-to-gcs.sh"
_script_local_repo_path="${{WORKSPACE}}/{git-basedir}/${{_script_repo_path}}"
mkdir -p "${{WORKSPACE}}/_tmp"
if [[ "${{PULL_BASE_REF:-}}" == 'master' && -x "${{_script_local_repo_path}}" ]]; then
# Force using the checked-out version if we're testing the master branch
ln -sf "${{_script_local_repo_path}}" "${{_script_tmp_path}}"
fi
# Download only if necessary; if this is called multiple times,
# we only want to download this script the first time.
if [[ ! -x "${{_script_tmp_path}}" ]]; then
rm -f "${{_script_tmp_path}}"
curl -fsS --retry 3 "https://raw.githubusercontent.com/kubernetes/kubernetes/master/${{_script_repo_path}}" > "${{_script_tmp_path}}"
chmod +x "${{_script_tmp_path}}"
fi
- publisher:
name: gcs-uploader
git-basedir: ''
publishers:
- postbuildscript:
builders:
- ensure-upload-to-gcs-script:
git-basedir: '{git-basedir}'
- shell: |
curl -fsS --retry 3 "http://pull-jenkins-master:8080/job/${{JOB_NAME}}/${{BUILD_NUMBER}}/consoleText" > "${{WORKSPACE}}/build-log.txt"
- conditional-step:
condition-kind: current-status
condition-worst: SUCCESS
condition-best: SUCCESS
steps:
- shell: 'JENKINS_BUILD_FINISHED=SUCCESS "${{WORKSPACE}}/_tmp/upload-to-gcs.sh"'
- conditional-step:
condition-kind: current-status
condition-worst: UNSTABLE
condition-best: UNSTABLE
steps:
- shell: 'JENKINS_BUILD_FINISHED=UNSTABLE "${{WORKSPACE}}/_tmp/upload-to-gcs.sh"'
- conditional-step:
condition-kind: current-status
condition-worst: FAILURE
condition-best: FAILURE
steps:
- shell: 'JENKINS_BUILD_FINISHED=FAILURE "${{WORKSPACE}}/_tmp/upload-to-gcs.sh"'
- conditional-step:
condition-kind: current-status
condition-worst: ABORTED
condition-best: ABORTED
steps:
- shell: 'JENKINS_BUILD_FINISHED=ABORTED "${{WORKSPACE}}/_tmp/upload-to-gcs.sh"'
script-only-if-succeeded: False
script-only-if-failed: False