Skip to content

Commit

Permalink
Add ArtemisUrl to env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
iyannsch committed Nov 12, 2024
1 parent 84f8eca commit 50b57cc
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions node/landing-page/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,17 +231,24 @@ function App(): JSX.Element {
TheiaCloud.ping(PingRequest.create(config.serviceUrl, config.appId))
.then(() => {
// ping successful continue with launch
// Artemis URLs look like: https://[email protected]/git/THEIATESTTESTEXERCISE/theiatesttestexercise-artemis_admin.git
// ^^^^^^^^^^^^^^^^^^^^^ we need this part
// First we split at the / character, get the last part, split at the - character and get the first part
const repoName = gitUri ? gitUri?.split('/').pop()?.split('-')[0] : Math.random().toString().substring(2, 10);
let workspace: string | undefined;

const workspace = config.useEphemeralStorage
? undefined
: 'ws-' + appDefinition + '-' + repoName + '-' + username;


console.log('Launching ' + appDefinition + ' in workspace ' + workspace);
if (config.useEphemeralStorage) {
workspace = undefined;
console.log('Launching ' + appDefinition + ' with ephemeral storage as not configured');
} else {
if (!gitUri) {
workspace = undefined;
console.log('Launching ' + appDefinition + ' with ephemeral storage as this is a Playground session');
} else {
// Artemis URLs look like: https://[email protected]/git/THEIATESTTESTEXERCISE/theiatesttestexercise-artemis_admin.git
// ^^^^^^^^^^^^^^^^^^^^^ we need this part
// First we split at the / character, get the last part, split at the - character and get the first part
const repoName = gitUri?.split('/').pop()?.split('-')[0] ?? Math.random().toString().substring(2, 10);
workspace = 'ws-' + appDefinition + '-' + repoName + '-' + username;
console.log('Launching ' + appDefinition + ' with persistent workspace ' + workspace);
}
}

const requestOptions: RequestOptions = {
timeout: 60000,
Expand Down

0 comments on commit 50b57cc

Please sign in to comment.