Skip to content

Commit 9f8e702

Browse files
authored
Merge branch 'main' into snyk-upgrade-36d60602c40679bce354b0273d5befff
2 parents 0770c87 + a9db3ed commit 9f8e702

2,842 files changed

Lines changed: 47974 additions & 29747 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.babelrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ module.exports = {
1111
"corejs": !process.env.NO_COREJS_POLYFILL ? '3.6' : undefined,
1212
"modules": process.env.BABEL_MODULES ? process.env.BABEL_MODULES === 'false' ? false : process.env.BABEL_MODULES : "commonjs" // babel's default is commonjs
1313
}],
14-
["@babel/typescript", { isTSX: true, allExtensions: true }],
15-
"@babel/react",
14+
["@babel/react", { runtime: 'classic' }],
15+
["@babel/typescript", { isTSX: true, allExtensions: true, allowDeclareFields: true }],
1616
[
1717
"@emotion/babel-preset-css-prop",
1818
{

.buildkite/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ agents:
55

66
steps:
77
- label: ":wave: Greetings!"
8-
command: "echo 'My first EUI pipeline!'"
8+
command: "echo 'The EUI CI pipeline, now with more robots'"
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# 🏠/.buildkite/pipelines/pipeline_pull_request_test.yml
1+
## 🏠/.buildkite/pipelines/pipeline_pull_request_deploy_docs.yml
22

33
steps:
4-
- label: ":hammer: EUI pull request deploy docs"
5-
command: "echo 'This will deploy our EUI docs!'"
6-
4+
- agents:
5+
provider: "gcp"
6+
command: .buildkite/scripts/pipeline_deploy_docs.sh
7+
if: build.branch != "main" # We don't want to deploy docs on main, only on manual release
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# 🏠/.buildkite/pipelines/pipeline_pull_request_test.yml
22

33
steps:
4-
- label: ":hammer: EUI pull request test"
5-
command: "echo 'This will run our EUI tests!'"
6-
4+
- agents:
5+
provider: "gcp"
6+
command: .buildkite/scripts/pipeline_test.sh
7+
if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup
8+
artifact_paths:
9+
- "cypress/screenshots/**/*.png"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## 🏠/.buildkite/pipelines/pipeline_pull_request_test_and_deploy.yml
2+
3+
steps:
4+
- trigger: "eui-pull-request-test"
5+
label: ":hammer: EUI pull request test"
6+
build:
7+
branch: "${BUILDKITE_BRANCH}"
8+
commit: "${BUILDKITE_COMMIT}"
9+
- trigger: "eui-pull-request-deploy-docs"
10+
label: ":newspaper: EUI pull request deploy docs"
11+
build:
12+
branch: "${BUILDKITE_BRANCH}"
13+
commit: "${BUILDKITE_COMMIT}"
14+
env:
15+
GIT_BRANCH: "${BUILDKITE_BRANCH}"
16+
GIT_PULL_REQUEST_ID: "${BUILDKITE_PULL_REQUEST}"
17+
BUILDKITE_CI: "${BUILDKITE}"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## 🏠/.buildkite/pipelines/pipeline_release_deploy_docs.yml
2+
3+
steps:
4+
- agents:
5+
provider: "gcp"
6+
command: .buildkite/scripts/pipeline_deploy_docs.sh
7+
env:
8+
GIT_BRANCH: "${BUILDKITE_BRANCH}"
9+
GIT_PULL_REQUEST_ID: "${BUILDKITE_PULL_REQUEST}"
10+
BUILDKITE_CI: "${BUILDKITE}"

.buildkite/pull-requests.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"jobs": [
3+
{
4+
"enabled": true,
5+
"pipeline_slug": "eui-pull-request-test-and-deploy",
6+
"allow_org_users": true,
7+
"allowed_repo_permissions": ["admin", "write"],
8+
"build_on_commit": true,
9+
"build_on_comment": true,
10+
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
11+
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
12+
"set_commit_status": true,
13+
"skip_ci_on_only_changed": ["^.github/", "^generator-eui/", "^wiki/"]
14+
}
15+
]
16+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
set +x
5+
6+
function retry {
7+
local retries=$1
8+
shift
9+
10+
local count=0
11+
12+
until "$@"; do
13+
exit=$?
14+
wait=$((2 ** count))
15+
count=$((count + 1))
16+
17+
if [ $count -lt "$retries" ]; then
18+
>&2 echo "Retry $count of $retries exited $exit. Retrying in $wait seconds."
19+
else
20+
>&2 echo "Retry $count of $retries exited $exit. No retries left."
21+
return $exit
22+
fi
23+
24+
done
25+
return 0
26+
}
27+
28+
VAULT_ACCOUNT=secret/ci/elastic-eui/bekitzur-kibana-service-account
29+
GITHUB_ACCOUNT=secret/ci/elastic-eui/kibanamachine
30+
31+
GCE_ACCOUNT=$(retry 5 vault read -field=value $VAULT_ACCOUNT)
32+
if [[ -z "${GCE_ACCOUNT}" ]]; then
33+
echo ":fire: GCP credentials not set." 1>&2
34+
exit 1
35+
fi
36+
37+
GITHUB_TOKEN=$(retry 5 vault read -field=github_token $GITHUB_ACCOUNT)
38+
if [[ -z "${GITHUB_TOKEN}" ]]; then
39+
echo ":fire: GitHub token not set." 1>&2
40+
exit 1
41+
fi
42+
43+
export GPROJECT=elastic-bekitzur
44+
export GCE_ACCOUNT
45+
export GITHUB_TOKEN
46+
47+
unset VAULT_ACCOUNT GITHUB_ACCOUNT
48+
49+
# Run EUI build/deploy script, set in the template parameter
50+
# Expects env: GPROJECT, GCE_ACCOUNT, GIT_BRANCH, GITHUB_TOKEN
51+
./scripts/deploy/deploy_docs
52+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
docker run \
6+
-i --rm \
7+
--env GIT_COMMITTER_NAME=test \
8+
--env GIT_COMMITTER_EMAIL=test \
9+
--env HOME=/tmp \
10+
--user="$(id -u):$(id -g)" \
11+
--volume="$(pwd):/app" \
12+
--workdir=/app \
13+
docker.elastic.co/eui/ci:5.2 \
14+
bash -c "/opt/yarn*/bin/yarn \
15+
&& yarn cypress install \
16+
&& NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-ci"

.ci/jobs/defaults.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
CI=true
2020
HOME=$JENKINS_HOME
2121
concurrent: true
22-
node: linux && !oraclelinux
22+
node: ubuntu-20.04
2323
scm:
2424
- git:
2525
name: origin

0 commit comments

Comments
 (0)