File tree Expand file tree Collapse file tree 1 file changed +11
-30
lines changed Expand file tree Collapse file tree 1 file changed +11
-30
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- set -x
3+ set -ex
44
55download_schema ()
66{
7- from=$1
8- to=$2
9-
10- for run in {1..5}
7+ rm -rf ${1} && mkdir -p ${1}
8+ for run in 1 2 3 4 5
119 do
12- curl -sf --compressed ${from} > ${to}
10+ curl --silent --fail https://codeload.github.com/elastic/apm-server/tar.gz/ ${2} | tar xzvf - --wildcards --directory= ${1} --strip-components=1 " */docs/spec/* "
1311 result=$?
1412 if [ $result -eq 0 ]; then break ; fi
1513 sleep 1
1614 done
17-
1815 if [ $result -ne 0 ]; then exit $result ; fi
16+
17+ mv -f ${1} /docs/spec/* ${1} /
18+ rm -rf ${1} /docs
19+
1920}
2021
2122# parent directory
2223basedir=$( dirname " $0 " ) /..
2324
24- FILES=( \
25- " errors/error.json" \
26- " errors/payload.json" \
27- " sourcemaps/payload.json" \
28- " transactions/mark.json" \
29- " transactions/payload.json" \
30- " transactions/span.json" \
31- " transactions/transaction.json" \
32- " context.json" \
33- " process.json" \
34- " request.json" \
35- " service.json" \
36- " stacktrace_frame.json" \
37- " system.json" \
38- " tags.json" \
39- " user.json" \
40- )
41-
42- mkdir -p ${basedir} /.schemacache/errors ${basedir} /.schemacache/transactions ${basedir} /.schemacache/sourcemaps
43-
44- for i in " ${FILES[@]} " ; do
45- download_schema https://raw.githubusercontent.com/elastic/apm-server/6.x/docs/spec/${i} ${basedir} /.schemacache/${i}
46- done
25+
26+ download_schema ${basedir} /.schemacache 6.4
27+
4728echo " Done."
You can’t perform that action at this time.
0 commit comments