-
Notifications
You must be signed in to change notification settings - Fork 838
/
Copy pathgenerate.sh
executable file
·47 lines (38 loc) · 1.47 KB
/
generate.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
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="${SCRIPT_DIR}/../../"
# freeze the spec version to make SpanAttributess generation reproducible
SPEC_VERSION=v1.7.0
GENERATOR_VERSION=0.7.0
cd ${SCRIPT_DIR}
rm -rf opentelemetry-specification || true
mkdir opentelemetry-specification
cd opentelemetry-specification
git init
git remote add origin https://github.com/open-telemetry/opentelemetry-specification.git
git fetch origin "$SPEC_VERSION" --depth=1
git reset --hard FETCH_HEAD
cd ${SCRIPT_DIR}
docker run --rm \
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/trace:/source \
-v ${SCRIPT_DIR}/templates:/templates \
-v ${ROOT_DIR}/packages/opentelemetry-semantic-conventions/src/trace/:/output \
otel/semconvgen:${GENERATOR_VERSION} \
-f /source \
code \
--template /templates/SemanticAttributes.ts.j2 \
--output /output/SemanticAttributes.ts \
-Dclass=SemanticAttributes
docker run --rm \
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/resource:/source \
-v ${SCRIPT_DIR}/templates:/templates \
-v ${ROOT_DIR}/packages/opentelemetry-semantic-conventions/src/resource/:/output \
otel/semconvgen:${GENERATOR_VERSION} \
-f /source \
code \
--template /templates/SemanticAttributes.ts.j2 \
--output /output/SemanticResourceAttributes.ts \
-Dclass=SemanticResourceAttributes
# Run the automatic linting fixing task to ensure it will pass eslint
cd "$ROOT_DIR"
npm run lint:fix:changed