Skip to content

Instantly share code, notes, and snippets.

@adamfortuno
Last active July 21, 2021 20:46
Show Gist options
  • Save adamfortuno/f49f815f85daec8e57f3a2e0313198e1 to your computer and use it in GitHub Desktop.
Save adamfortuno/f49f815f85daec8e57f3a2e0313198e1 to your computer and use it in GitHub Desktop.
DataStax Studio server script (written in PowerShell) Created for Testing Purposes
Set-StrictMode -version 5.0
$ErrorActionPreference = 'Stop'
$env:JAVA_HOME = 'C:\Program Files\Java\jre1.8.0_301\'
$script_path = $MyInvocation.MyCommand.Path
$script_directory = Split-Path -Parent $script_path
$install_directory = Split-Path -Parent $script_directory
$install_lib_directory = "${install_directory}\lib\"
# Add all JARs to the classpath
$SERVER_CLASSPATH = "${install_directory}\studio-server-6.8.14-RC1.jar"
Get-ChildItem "${install_lib_directory}\" | `
% { $SERVER_CLASSPATH = "${SERVER_CLASSPATH};$(${_}.fullname)" }
# Capture WAR and directory paths into variables for JAVA call
$API_WAR = "${install_lib_directory}\studio-api-6.8.14-RC1.war"
$GREMLIN_IDE_WAR_DSE_6_0_x = `
"${install_lib_directory}\com.datastax.studio.ide.gremlin.web.dse_6_0_x-6.8.14.war"
$GREMLIN_IDE_WAR_DSE_6_8_x = `
"${install_lib_directory}\com.datastax.studio.ide.gremlin.web.dse_6_8_x-6.8.14.war"
$CQL_IDE_WAR = `
"${install_lib_directory}\com.datastax.studio.ide.cql.web-6.8.14.war"
$SPARK_SQL_IDE_WAR = `
"${install_lib_directory}\com.datastax.studio.ide.spark.sql.web-6.8.14.war"
$UI_DIR = "${install_directory}\ui\"
$MAIN_CLASS="com.datastax.studio.server.Bootstrap"
# Change file system context to the install folder
Set-Location -Path $install_directory
& 'C:\Program Files\Java\jre1.8.0_301\bin\java.exe' `
-cp $SERVER_CLASSPATH `
$MAIN_CLASS `
$UI_DIR `
$API_WAR `
$CQL_IDE_WAR `
$SPARK_SQL_IDE_WAR `
$GREMLIN_IDE_WAR_DSE_6_0_x `
$GREMLIN_IDE_WAR_DSE_6_8_x
@adamfortuno
Copy link
Author

Here is a screen grab of the solution launching...

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment