Skip to content

Commit dcf0379

Browse files
authored
Add CEL Common Expression Language to scripts that grap protos" (#359)
Signed-off-by: rulex123 <[email protected]>
1 parent 03a135e commit dcf0379

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

tools/update-api.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,8 @@ curl -sL https://github.com/open-telemetry/opentelemetry-proto/archive/v${OPENTE
6464
mkdir -p "${protodir}/opentelemetry/proto"
6565
cp -r opentelemetry-proto-*/opentelemetry/proto/* "${protodir}/opentelemetry/proto"
6666

67+
curl -sL https://github.com/google/cel-spec/archive/v${CEL_VERSION}.tar.gz | tar xz --wildcards '*.proto'
68+
mkdir -p "${protodir}/cel-spec"
69+
cp -r cel-spec-*/proto/* "${protodir}/cel-spec"
70+
6771
popd >/dev/null

tools/update-sha.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ set -o xtrace
88
function find_sha() {
99
local CONTENT=$1
1010
local DEPENDENCY=$2
11-
echo "$CONTENT" | grep "$DEPENDENCY" -A 11 | grep -m 1 version | awk '{ print $3 }' | tr -d '"' | tr -d ","
11+
echo "$CONTENT" | grep "$DEPENDENCY" -A 11 | grep -m 1 "version =" | awk '{ print $3 }' | tr -d '"' | tr -d ","
1212
}
1313

1414
function find_date() {
1515
local CONTENT=$1
1616
local DEPENDENCY=$2
17-
echo "$CONTENT" | grep "$DEPENDENCY" -A 11 | grep -m 1 release_date | awk '{ print $3 }' | tr -d '"' | tr -d ","
17+
echo "$CONTENT" | grep "$DEPENDENCY" -A 11 | grep -m 1 "release_date =" | awk '{ print $3 }' | tr -d '"' | tr -d ","
1818
}
1919

2020
function find_envoy_sha_from_tag() {
@@ -45,6 +45,9 @@ XDS_DATE=$(find_date "$CURL_OUTPUT" com_github_cncf_xds)
4545
OPENTELEMETRY_SHA=$(find_sha "$CURL_OUTPUT" opentelemetry_proto)
4646
OPENTELEMETRY_DATE=$(find_date "$CURL_OUTPUT" opentelemetry_proto)
4747

48+
CEL_SHA=$(find_sha "$CURL_OUTPUT" dev_cel)
49+
CEL_DATE=$(find_date "$CURL_OUTPUT" dev_cel)
50+
4851
echo -n "# Update the versions here and run update-api.sh
4952
5053
# envoy (source: SHA from https://github.com/envoyproxy/envoy)
@@ -56,6 +59,7 @@ PGV_VERSION=\"$PGV_GIT_SHA\" # $PGV_GIT_DATE
5659
PROMETHEUS_SHA=\"$PROMETHEUS_SHA\" # $PROMETHEUS_DATE
5760
OPENCENSUS_VERSION=\"$OPENCENSUS_SHA\" # $OPENCENSUS_DATE
5861
OPENTELEMETRY_VERSION=\"$OPENTELEMETRY_SHA\" # $OPENTELEMETRY_DATE
62+
CEL_VERSION=\"$CEL_SHA\" # $CEL_DATE
5963
XDS_SHA=\"$XDS_SHA\" # $XDS_DATE
6064
"
6165

0 commit comments

Comments
 (0)