Skip to content

Commit

Permalink
CLDR-17270 datadog sourcemap upload
Browse files Browse the repository at this point in the history
  • Loading branch information
srl295 committed Dec 28, 2023
1 parent 1a0b926 commit b630e6c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ jobs:
-DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: DataDog sourcemap upload
run: npx --package=@datadog/datadog-ci datadog-ci sourcemaps upload tools/cldr-apps/src/main/webapp/dist/ --minified-path-prefix=/cldr-apps/dist/ --release-version=r${{ github.event.inputs.git-ref }} --service=surveytool
env:
DATADOG_SITE: ${{ secrets.DATADOG_SITE }}
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
- name: Build liberty server
run: >
mvn -s .github/workflows/mvn-settings.xml -B -pl cldr-apps liberty:create liberty:deploy liberty:package -Dinclude=usr --file tools/pom.xml
Expand Down
3 changes: 1 addition & 2 deletions tools/cldr-apps/js/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ if (window.dataDogClientToken) {
site: "us5.datadoghq.com",
service: "surveytool",
env: window.dataDogEnv,
// Specify a version number to identify the deployed version of your application in Datadog
// version: '1.0.0',
version: "r" + window.dataDogSha,
sessionSampleRate: 100,
sessionReplaySampleRate: 20,
trackUserInteractions: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ private void includeCss(HttpServletRequest request, PrintWriter out) {

private static final String DD_CLIENT_TOKEN = System.getenv("DD_CLIENT_TOKEN");
private static final String DD_CLIENT_APPID = System.getenv("DD_CLIENT_APPID");
private static final String DD_GIT_COMMIT_SHA = System.getenv("DD_GIT_COMMIT_SHA");
private static final String DD_ENV = System.getProperty("dd.env", "");

/** if DD_CLIENT_TOKEN is set, set these variables so index.js can pick them up. */
Expand All @@ -233,8 +234,9 @@ public static void includeDatadog(Writer out) throws IOException {
+ "window.dataDogClientToken='%s';\n"
+ "window.dataDogAppId='%s';\n"
+ "window.dataDogEnv='%s';\n"
+ "window.dataDogSha='%s';\n"
+ "</script>\n",
DD_CLIENT_TOKEN, DD_CLIENT_APPID, DD_ENV));
DD_CLIENT_TOKEN, DD_CLIENT_APPID, DD_ENV, DD_GIT_COMMIT_SHA));
} else {
out.write("<script>window.dataDogClientToken='';</script>\n");
}
Expand Down

0 comments on commit b630e6c

Please sign in to comment.