-
Notifications
You must be signed in to change notification settings - Fork 836
/
Copy pathgenerate.sh
executable file
·43 lines (34 loc) · 1.23 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
#!/bin/bash
set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="${SCRIPT_DIR}/../../"
# Get latest version by running `git tag -l --sort=version:refname | tail -1`
# ... in [email protected]:open-telemetry/semantic-conventions.git
SPEC_VERSION=v1.28.0
# ... in [email protected]:open-telemetry/weaver.git
GENERATOR_VERSION=v0.10.0
# When running on windows and your are getting references to ";C" (like Telemetry;C)
# then this is an issue with the bash shell, so first run the following in your shell:
# export MSYS_NO_PATHCONV=1
cd ${SCRIPT_DIR}
rm -rf semantic-conventions || true
mkdir semantic-conventions
cd semantic-conventions
git init
git remote add origin https://github.com/open-telemetry/semantic-conventions.git
git fetch origin "${SPEC_VERSION}" --depth=1
git reset --hard FETCH_HEAD
cd ${SCRIPT_DIR}
docker run --rm --platform linux/amd64 \
-v ${SCRIPT_DIR}/semantic-conventions/model:/source \
-v ${SCRIPT_DIR}/templates:/weaver/templates \
-v ${ROOT_DIR}/semantic-conventions/src/:/output \
otel/weaver:$GENERATOR_VERSION \
registry generate \
--registry=/source \
--templates=/weaver/templates \
stable \
/output/
# Ensure semconv compiles
cd "${ROOT_DIR}/semantic-conventions"
npm run compile