@envsync-cloud/deploy-cli 0.6.6 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +22 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -635,6 +635,10 @@ function renderTraefikDynamicConfig(config) {
|
|
|
635
635
|
" loadBalancer:",
|
|
636
636
|
" servers:",
|
|
637
637
|
" - url: http://web_nginx:8080",
|
|
638
|
+
" browser-otlp:",
|
|
639
|
+
" loadBalancer:",
|
|
640
|
+
" servers:",
|
|
641
|
+
` - url: http://clickstack:${config.services.clickstack_otlp_http_port}`,
|
|
638
642
|
" routers:",
|
|
639
643
|
" landing-router:",
|
|
640
644
|
` rule: Host(\`${hosts.landing}\`)`,
|
|
@@ -646,6 +650,18 @@ function renderTraefikDynamicConfig(config) {
|
|
|
646
650
|
" service: web",
|
|
647
651
|
" entryPoints: [websecure]",
|
|
648
652
|
" tls: {}",
|
|
653
|
+
" landing-otlp-router:",
|
|
654
|
+
` rule: Host(\`${hosts.landing}\`) && (PathPrefix(\`/v1/traces\`) || PathPrefix(\`/v1/logs\`) || PathPrefix(\`/v1/metrics\`))`,
|
|
655
|
+
" service: browser-otlp",
|
|
656
|
+
" priority: 100",
|
|
657
|
+
" entryPoints: [websecure]",
|
|
658
|
+
" tls: {}",
|
|
659
|
+
" web-otlp-router:",
|
|
660
|
+
` rule: Host(\`${hosts.app}\`) && (PathPrefix(\`/v1/traces\`) || PathPrefix(\`/v1/logs\`) || PathPrefix(\`/v1/metrics\`))`,
|
|
661
|
+
" service: browser-otlp",
|
|
662
|
+
" priority: 100",
|
|
663
|
+
" entryPoints: [websecure]",
|
|
664
|
+
" tls: {}",
|
|
649
665
|
" api-router:",
|
|
650
666
|
` rule: Host(\`${hosts.api}\`)`,
|
|
651
667
|
" service: envsync-api",
|
|
@@ -666,15 +682,17 @@ function renderNginxConf(kind) {
|
|
|
666
682
|
"}"
|
|
667
683
|
].join("\n") + "\n";
|
|
668
684
|
}
|
|
669
|
-
function renderFrontendRuntimeConfig(config) {
|
|
685
|
+
function renderFrontendRuntimeConfig(config, kind) {
|
|
670
686
|
const hosts = domainMap(config.domain.root_domain);
|
|
687
|
+
const otelEndpoint = kind === "web" ? `https://${hosts.app}` : `https://${hosts.landing}`;
|
|
671
688
|
return `window.__ENVSYNC_RUNTIME_CONFIG__ = ${JSON.stringify({
|
|
672
689
|
apiBaseUrl: `https://${hosts.api}`,
|
|
673
690
|
appBaseUrl: `https://${hosts.app}`,
|
|
674
691
|
authBaseUrl: `https://${hosts.auth}`,
|
|
675
692
|
keycloakRealm: config.auth.keycloak_realm,
|
|
676
693
|
webClientId: config.auth.web_client_id,
|
|
677
|
-
apiDocsUrl: `https://${hosts.api}/docs
|
|
694
|
+
apiDocsUrl: `https://${hosts.api}/docs`,
|
|
695
|
+
otelEndpoint
|
|
678
696
|
}, null, 2)};
|
|
679
697
|
`;
|
|
680
698
|
}
|
|
@@ -1587,8 +1605,8 @@ async function cmdDeploy() {
|
|
|
1587
1605
|
}
|
|
1588
1606
|
extractStaticBundle(config.images.web, `${RELEASES_ROOT}/web/current`);
|
|
1589
1607
|
extractStaticBundle(config.images.landing, `${RELEASES_ROOT}/landing/current`);
|
|
1590
|
-
writeFileMaybe(`${RELEASES_ROOT}/web/current/runtime-config.js`, renderFrontendRuntimeConfig(config));
|
|
1591
|
-
writeFileMaybe(`${RELEASES_ROOT}/landing/current/runtime-config.js`, renderFrontendRuntimeConfig(config));
|
|
1608
|
+
writeFileMaybe(`${RELEASES_ROOT}/web/current/runtime-config.js`, renderFrontendRuntimeConfig(config, "web"));
|
|
1609
|
+
writeFileMaybe(`${RELEASES_ROOT}/landing/current/runtime-config.js`, renderFrontendRuntimeConfig(config, "landing"));
|
|
1592
1610
|
if (currentOptions.dryRun) {
|
|
1593
1611
|
logDryRun(`Would deploy full stack for ${config.services.stack_name}`);
|
|
1594
1612
|
logCommand("docker", ["stack", "deploy", "-c", STACK_FILE, config.services.stack_name]);
|