-
Notifications
You must be signed in to change notification settings - Fork 7
/
travis.inc.sh
136 lines (127 loc) · 3.07 KB
/
travis.inc.sh
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/usr/bin/env bash
# shellcheck disable=SC2034
set -euo pipefail
function yp_ci_env_travis() {
[[ "${TRAVIS:-}" = "true" ]] || return 0
export CI=true
YP_CI_NAME="Travis CI"
YP_CI_PLATFORM=travis
YP_CI_SERVER_HOST=travis-ci.org
YP_CI_REPO_SLUG=${TRAVIS_REPO_SLUG:-}
YP_CI_ROOT=${TRAVIS_BUILD_DIR:-}
YP_CI_IS_CRON=
[[ "${TRAVIS_EVENT_TYPE:-}" != "cron" ]] || YP_CI_IS_CRON=true
YP_CI_IS_PR=
[[ "${TRAVIS_EVENT_TYPE:-}" != "pull_request" ]] || YP_CI_IS_PR=true
YP_CI_JOB_ID=${TRAVIS_JOB_ID:-}
YP_CI_PIPELINE_ID=${TRAVIS_BUILD_NUMBER:-}
YP_CI_JOB_URL=${TRAVIS_JOB_WEB_URL:-}
YP_CI_PIPELINE_URL=${TRAVIS_BUILD_WEB_URL:-}
YP_CI_PR_NUMBER=
YP_CI_PR_URL=
YP_CI_PR_REPO_SLUG=
YP_CI_PR_GIT_HASH=
YP_CI_PR_GIT_BRANCH=
[[ "${YP_CI_IS_PR}" != "true" ]] || {
YP_CI_PR_NUMBER=${TRAVIS_PULL_REQUEST:-}
YP_CI_PR_URL=https://github.com/${YP_CI_REPO_SLUG}/pull/${YP_CI_PR_NUMBER}
YP_CI_PR_REPO_SLUG=${TRAVIS_PULL_REQUEST_SLUG:-}
YP_CI_PR_GIT_HASH=${TRAVIS_PULL_REQUEST_SHA:-}
YP_CI_PR_GIT_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-}
}
YP_CI_GIT_HASH=${TRAVIS_COMMIT:-}
YP_CI_GIT_BRANCH=${TRAVIS_BRANCH:-}
YP_CI_GIT_TAG=${TRAVIS_TAG:-}
YP_CI_DEBUG_MODE=${TRAVIS_DEBUG_MODE:-}
}
function yp_ci_printvars_travis() {
printenv_all | sort -u | grep \
-e "^CI[=_]" \
-e "^CONTINUOUS_INTEGRATION$" \
-e "^HAS_JOSH_K_SEAL_OF_APPROVAL$" \
-e "^TRAVIS[=_]"
}
function yp_ci_known_env_travis() {
# see https://docs-staging.travis-ci.com/user/environment-variables/#default-environment-variables
cat <<EOF
CI
TRAVIS
CONTINUOUS_INTEGRATION
HAS_JOSH_K_SEAL_OF_APPROVAL
TRAVIS_ALLOW_FAILURE
TRAVIS_APP_HOST
TRAVIS_BRANCH
TRAVIS_BUILD_DIR
TRAVIS_BUILD_ID
TRAVIS_BUILD_NUMBER
TRAVIS_BUILD_WEB_URL
TRAVIS_COMMIT
TRAVIS_COMMIT_MESSAGE
TRAVIS_COMMIT_RANGE
TRAVIS_COMPILER
TRAVIS_DEBUG_MODE
TRAVIS_DIST
TRAVIS_EVENT_TYPE
TRAVIS_JOB_ID
TRAVIS_JOB_NAME
TRAVIS_JOB_NUMBER
TRAVIS_JOB_WEB_URL
TRAVIS_OS_NAME
TRAVIS_CPU_ARCH
TRAVIS_OSX_IMAGE
TRAVIS_PULL_REQUEST
TRAVIS_PULL_REQUEST_BRANCH
TRAVIS_PULL_REQUEST_SHA
TRAVIS_PULL_REQUEST_SLUG
TRAVIS_REPO_SLUG
TRAVIS_SECURE_ENV_VARS
TRAVIS_SUDO
TRAVIS_TEST_RESULT
TRAVIS_TAG
TRAVIS_BUILD_STAGE_NAME
TRAVIS_DART_VERSION
TRAVIS_GO_VERSION
TRAVIS_HAXE_VERSION
TRAVIS_JDK_VERSION
TRAVIS_JULIA_VERSION
TRAVIS_NODE_VERSION
TRAVIS_OTP_RELEASE
TRAVIS_PERL_VERSION
TRAVIS_PHP_VERSION
TRAVIS_PYTHON_VERSION
TRAVIS_R_VERSION
TRAVIS_RUBY_VERSION
TRAVIS_RUST_VERSION
TRAVIS_SCALA_VERSION
TRAVIS_MARIADB_VERSION
TRAVIS_XCODE_SDK
TRAVIS_XCODE_SCHEME
TRAVIS_XCODE_PROJECT
TRAVIS_XCODE_WORKSPACE
EOF
# undocumented but observed
cat <<EOF
TRAVIS_APT_PROXY
TRAVIS_ARCH
TRAVIS_CMD
TRAVIS_ENABLE_INFRA_DETECTION
TRAVIS_FILTERED
TRAVIS_HOME
TRAVIS_INFRA
TRAVIS_INIT
TRAVIS_INTERNAL_RUBY_REGEX
TRAVIS_LANGUAGE
TRAVIS_PRE_CHEF_BOOTSTRAP_TIME
TRAVIS_ROOT
TRAVIS_STACK_FEATURES
TRAVIS_STACK_JOB_BOARD_REGISTER
TRAVIS_STACK_LANGUAGES
TRAVIS_STACK_NAME
TRAVIS_STACK_NODE_ATTRIBUTES
TRAVIS_STACK_TIMESTAMP
TRAVIS_TIMER_ID
TRAVIS_TIMER_START_TIME
TRAVIS_TMPDIR
TRAVIS_UID
EOF
}