diff --git a/.werft/jobs/build/deploy-to-preview-environment.ts b/.werft/jobs/build/deploy-to-preview-environment.ts index 0a8ffb08727801..1674f30843a385 100644 --- a/.werft/jobs/build/deploy-to-preview-environment.ts +++ b/.werft/jobs/build/deploy-to-preview-environment.ts @@ -103,6 +103,7 @@ export async function deployToPreviewEnvironment(werft: Werft, jobConfig: JobCon withEELicense: deploymentConfig.installEELicense, workspaceFeatureFlags: workspaceFeatureFlags, withSlowDatabase: jobConfig.withSlowDatabase, + withDedicatedEmulation: jobConfig.withDedicatedEmulation, }); try { werft.log(installerSlices.INSTALL, "deploying using installer"); diff --git a/.werft/jobs/build/installer/installer.ts b/.werft/jobs/build/installer/installer.ts index cd09ad7ed7109a..0dd68f4942329d 100644 --- a/.werft/jobs/build/installer/installer.ts +++ b/.werft/jobs/build/installer/installer.ts @@ -11,6 +11,7 @@ export type InstallerOptions = { withEELicense: boolean; workspaceFeatureFlags: string[]; withSlowDatabase: boolean; + withDedicatedEmulation: boolean; }; export class Installer { @@ -31,6 +32,7 @@ export class Installer { GITPOD_WORKSPACE_FEATURE_FLAGS: this.options.workspaceFeatureFlags.join(" "), GITPOD_WITH_SLOW_DATABASE: this.options.withSlowDatabase, GITPOD_WITH_EE_LICENSE: this.options.withEELicense, + GITPOD_WITH_DEDICATED_EMU: this.options.withDedicatedEmulation, }; const variables = Object.entries(environment) .map(([key, value]) => `${key}="${value}"`) diff --git a/.werft/jobs/build/job-config.ts b/.werft/jobs/build/job-config.ts index 7314c63f9cdcf4..8d732d810ca98f 100644 --- a/.werft/jobs/build/job-config.ts +++ b/.werft/jobs/build/job-config.ts @@ -34,6 +34,7 @@ export interface JobConfig { withObservability: boolean; withLocalPreview: boolean; withSlowDatabase: boolean; + withDedicatedEmulation: boolean; workspaceFeatureFlags: string[]; previewEnvironment: PreviewEnvironmentConfig; repository: Repository; @@ -107,6 +108,7 @@ export function jobConfig(werft: Werft, context: any): JobConfig { const recreatePreview = "recreate-preview" in buildConfig const recreateVm = mainBuild || "recreate-vm" in buildConfig; const withSlowDatabase = "with-slow-database" in buildConfig && !mainBuild; + const withDedicatedEmulation = "with-dedicated-emulation" in buildConfig && !mainBuild; const storageClass = buildConfig["storage-class"] || ""; const analytics = parseAnalytics(werft, sliceId, buildConfig["analytics"]) @@ -183,6 +185,7 @@ export function jobConfig(werft: Werft, context: any): JobConfig { recreateVm, withSlowDatabase, withGitHubActions, + withDedicatedEmulation, }; werft.logOutput(sliceId, JSON.stringify(jobConfig, null, 2)); diff --git a/dev/preview/workflow/preview/deploy-gitpod.sh b/dev/preview/workflow/preview/deploy-gitpod.sh index ca9b1f117b3568..7638b351b305f8 100755 --- a/dev/preview/workflow/preview/deploy-gitpod.sh +++ b/dev/preview/workflow/preview/deploy-gitpod.sh @@ -29,6 +29,7 @@ GITPOD_ANALYTICS="${GITPOD_ANALYTICS:-}" GITPOD_WITH_EE_LICENSE="${GITPOD_WITH_EE_LICENSE:-true}" GITPOD_WORKSPACE_FEATURE_FLAGS="${GITPOD_WORKSPACE_FEATURE_FLAGS:-}" GITPOD_WITH_SLOW_DATABASE="${GITPOD_WITH_SLOW_DATABASE:-false}" +GITPOD_WITH_DEDICATED_EMU="${GITPOD_WITH_DEDICATED_EMU:-false}" if [[ "${VERSION:-}" == "" ]]; then if [[ ! -f /tmp/local-dev-version ]]; then @@ -333,24 +334,29 @@ yq w -i "${INSTALLER_CONFIG_PATH}" observability.tracing.endpoint "${TRACING_END # # configureAuthProviders # -for row in $(kubectl --kubeconfig "$DEV_KUBE_PATH" --context "${DEV_KUBE_CONTEXT}" get secret preview-envs-authproviders-harvester --namespace=keys -o jsonpath="{.data.authProviders}" \ -| base64 -d -w 0 \ -| yq r - authProviders -j \ -| jq -r 'to_entries | .[] | @base64'); do - key=$(echo "${row}" | base64 -d | jq -r '.key') - providerId=$(echo "$row" | base64 -d | jq -r '.value.id | ascii_downcase') - data=$(echo "$row" | base64 -d | yq r - value --prettyPrint) - yq w -i "${INSTALLER_CONFIG_PATH}" authProviders["$key"].kind "secret" - yq w -i "${INSTALLER_CONFIG_PATH}" authProviders["$key"].name "$providerId" - - kubectl create secret generic "$providerId" \ - --namespace "${PREVIEW_NAMESPACE}" \ - --kubeconfig "${PREVIEW_K3S_KUBE_PATH}" \ - --context "${PREVIEW_K3S_KUBE_CONTEXT}" \ - --from-literal=provider="$data" \ - --dry-run=client -o yaml | \ - kubectl --kubeconfig "${PREVIEW_K3S_KUBE_PATH}" --context "${PREVIEW_K3S_KUBE_CONTEXT}" replace --force -f - -done + +if [[ "${GITPOD_WITH_DEDICATED_EMU}" != "true" ]] +then + for row in $(kubectl --kubeconfig "$DEV_KUBE_PATH" --context "${DEV_KUBE_CONTEXT}" get secret preview-envs-authproviders-harvester --namespace=keys -o jsonpath="{.data.authProviders}" \ + | base64 -d -w 0 \ + | yq r - authProviders -j \ + | jq -r 'to_entries | .[] | @base64'); do + key=$(echo "${row}" | base64 -d | jq -r '.key') + providerId=$(echo "$row" | base64 -d | jq -r '.value.id | ascii_downcase') + data=$(echo "$row" | base64 -d | yq r - value --prettyPrint) + yq w -i "${INSTALLER_CONFIG_PATH}" authProviders["$key"].kind "secret" + yq w -i "${INSTALLER_CONFIG_PATH}" authProviders["$key"].name "$providerId" + + kubectl create secret generic "$providerId" \ + --namespace "${PREVIEW_NAMESPACE}" \ + --kubeconfig "${PREVIEW_K3S_KUBE_PATH}" \ + --context "${PREVIEW_K3S_KUBE_CONTEXT}" \ + --from-literal=provider="$data" \ + --dry-run=client -o yaml | \ + kubectl --kubeconfig "${PREVIEW_K3S_KUBE_PATH}" --context "${PREVIEW_K3S_KUBE_CONTEXT}" replace --force -f - + done +fi + # # configureStripeAPIKeys