In order to perform Solsta deployments, Runners on your GitLab CI/CD instance will need to have the following components installed:
These variables can be set in the Settings > CI/CD section of your GitLab project where they can be protected and masked (see image below for an example).
SOLSTA_DEPLOY_SOURCE_PATH: s3://mybucket/mybuilds/v38.1.2/
In Solsta, an environment will typically consist of multiple repositories (independent components) of your game or software product. For example, a “daily-dev” environment could consist of unique iterations of each of the following repositories
When the Solsta Dekstop Application installs this environment on machines, it will re-create the folder structure and files for each repository into a single user-specified installation directory. This means there must not be any overlap between files across repositories. If you want the client to re-create a specific sub-directory for a repository, then you must specify the proper directory when deploying releases within that repository.
For example, when deploying releases to a “mods” repository, you can specify up to the /mods/ folder in the “Working Directory” field of the Solsta Deploy Step. This will make the Solsta Desktop App re-create the structure of the the /mods/ folder as seen below:
If you prefer the Solsta Desktop App to re-create a “mods” folder instead, then you will need to specify the parent directory containing “mods” when you deploy. For example:
You can go as far up your directory tree as you need during deployment to have the Solsta Desktop App re-create the folder structure for each repository. You will need to make sure files and folders specific to the repository are isolated. Options for excluding or including specific sub-directories are upcoming.
variables:
SOLSTA_PRODUCT: llamacraft
SOLSTA_ENV: dev-nightly
SOLSTA_REPOSITORY: game-client
SOLSTA_RELEASE_VERSION: 1.0.13
SOLSTA_CONSOLE_VERSION: 6.1.2.84
SOLSTA_SCRIPTS_VERSION: 3.7.30
SOLSTA_CONSOLE_DIR: c:/temp/direct/
SOLSTA_DEPLOY_SOURCE_PATH: "../bin/"
.shared_windows_runners:
tags:
- shared-windows
- windows
- windows-1809
stages: [build]
build:jdk8:
extends:
- .shared_windows_runners
stage: build
script:
- echo "Your Build Happens Here"
- echo "Your Build Artifacts Are now in bin/"
- echo "SSN Deploy Script Version 2"
# Install Chocolatey, in order to install python3 and dotnet6
- iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
- $Env:PATH="$Env:PATH;$Env:ALLUSERSPROFILE/chocolatey/bin/"
- choco.exe install -y python3
- choco.exe install -y dotnet-6.0-sdk
- $Env:PATH = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
# Remove the old deploy script directory
- if (Test-Path -Path deploy) { rm -r -fo deploy }
# Download the latest deploy scripts
- mkdir deploy
- cd deploy
- wget -UseBasicParsing -O deploy-scripts-$Env:SOLSTA_SCRIPTS_VERSION.zip https://releases.snxd.com/deploy-scripts-$Env:SOLSTA_SCRIPTS_VERSION.zip
- Expand-Archive deploy-scripts-$Env:SOLSTA_SCRIPTS_VERSION.zip -DestinationPath .
# Generate console credential file from env vars
- echo "{""consoleCredentials"":{""audience"":""https://axis.snxd.com/"",""clientId"":""$Env:SOLSTA_CLIENT_ID"",""clientSecret"":""$Env:SOLSTA_CLIENT_SECRET"",""grant"":""clientCredentials"",""scope"":""d4tv1""}}" | out-file -encoding ASCII client_credentials.json
# Create the python venv in the deploy directory
- if (!(Test-Path -Path venv)) { python -m venv venv }
# Activate the new python environment
- venv\Scripts\activate
# Install any missing deploy script dependencies
- pip install -r requirements.txt
# Download the latest SSN Console Tools if necessary
- if (!(Test-Path -Path $Env:SOLSTA_CONSOLE_DIR$Env:SOLSTA_CONSOLE_VERSION/console)) { python direct_get.py --overwrite --version=$Env:SOLSTA_CONSOLE_VERSION --component=console --target_directory=$Env:SOLSTA_CONSOLE_DIR$Env:SOLSTA_CONSOLE_VERSION --console_credentials=client_credentials.json }
# Run the script that creates a new release and deploys it
- $SOLSTA_EXTRA_ARGS = ""
- if ( "$Env:SOLSTA_RELEASE_VERSION" -ne "" ) { $SOLSTA_EXTRA_ARGS+="--version=$Env:SOLSTA_RELEASE_VERSION " }
- python release_deploy.py --autocreate --debug --console_credentials=client_credentials.json --console_directory=$Env:SOLSTA_CONSOLE_DIR$Env:SOLSTA_CONSOLE_VERSION/console --product_name=$Env:SOLSTA_PRODUCT --env_name=$Env:SOLSTA_ENV --repository_name=$Env:SOLSTA_REPOSITORY --source=$Env:SOLSTA_DEPLOY_SOURCE_PATH $SOLSTA_EXTRA_ARGS
variables:
SOLSTA_PRODUCT: llamacraft
SOLSTA_ENV: dev-nightly
SOLSTA_REPOSITORY: game-client
SOLSTA_RELEASE_VERSION: 1.0.14
SOLSTA_CONSOLE_VERSION: 6.1.2.84
SOLSTA_SCRIPTS_VERSION: 3.7.30
SOLSTA_CONSOLE_DIR: "/home/gitlab-runner/direct/"
SOLSTA_DEPLOY_SOURCE_PATH: "../bin/"
image: maven:3.3.9-jdk-8
stages: [build]
build:jdk8:
stage: build
script:
- echo "Your Build Happens Here"
- echo "Your Build Artifacts Are now in bin/"
# Remove the old deploy script directory
- echo "SSN Deploy Script Version 2"
- if [ -d "deploy" ]; then rm -Rf deploy; fi
# Download the latest deploy scripts
- mkdir deploy
- cd deploy
- wget https://releases.snxd.com/deploy-scripts-$SOLSTA_SCRIPTS_VERSION.zip
- unzip deploy-scripts-$SOLSTA_SCRIPTS_VERSION.zip
# Generate console credential file from env vars
- echo "{\"consoleCredentials\":{\"audience\":\"https://axis.snxd.com/\",\"clientId\":\"$SOLSTA_CLIENT_ID\",\"clientSecret\":\"$SOLSTA_CLIENT_SECRET\",\"grant\":\"clientCredentials\",\"scope\":\"d4tv1\"}}" > client_credentials.json
# Create the python venv in the deploy directory
- if [ ! -f "venv" ]; then python3 -m venv venv ; fi
# Activate the new python environment
- source venv/bin/activate
# Install any missing deploy script dependencies
- pip install -r requirements.txt
# Download the latest SSN Console Tools if necessary
- if [ ! -d "$SOLSTA_CONSOLE_DIR$SOLSTA_CONSOLE_VERSION/console" ]; then python direct_get.py --overwrite --version=$SOLSTA_CONSOLE_VERSION --target_directory=$SOLSTA_CONSOLE_DIR$SOLSTA_CONSOLE_VERSION --component=console --console_credentials=client_credentials.json ; fi
# Run the script that creates a new release and deploys it
- SOLSTA_EXTRA_ARGS=""
- if [ ! "$SOLSTA_RELEASE_VERSION" = "" ]; then SOLSTA_EXTRA_ARGS+="--version=$SOLSTA_RELEASE_VERSION " ; fi ;
- python release_deploy.py --autocreate --debug --console_credentials=client_credentials.json --console_directory=$SOLSTA_CONSOLE_DIR$SOLSTA_CONSOLE_VERSION/console --product_name=$SOLSTA_PRODUCT --env_name=$SOLSTA_ENV --repository_name=$SOLSTA_REPOSITORY --source=$SOLSTA_DEPLOY_SOURCE_PATH $SOLSTA_EXTRA_ARGS
variables:
SOLSTA_SOURCE_PRODUCT: llamacraft
SOLSTA_SOURCE_ENV: dev-nightly
SOLSTA_SOURCE_REPOSITORY: game-client
SOLSTA_CONSOLE_VERSION: 6.1.2.84
SOLSTA_SCRIPTS_VERSION: 3.7.30
SOLSTA_CONSOLE_DIR: c:/temp/direct/
SOLSTA_PROMOTE_TARGET_PRODUCT: llamacraft
SOLSTA_PROMOTE_TARGET_ENV: qa-internal
SOLSTA_PROMOTE_TARGET_REPOSITORY: game-client
.shared_windows_runners:
tags:
- shared-windows
- windows
- windows-1809
stages: [promote]
promote:jdk8:
extends:
- .shared_windows_runners
stage: promote
script:
- echo "SSN Promote Script Version 2"
# Install Chocolatey, in order to install python3 and dotnet6
- iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
- $Env:PATH="$Env:PATH;$Env:ALLUSERSPROFILE/chocolatey/bin/"
- choco.exe install -y python3
- choco.exe install -y dotnet-6.0-sdk
- $Env:PATH = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
# Remove the old deploy script directory
- if (Test-Path -Path deploy) { rm -r -fo deploy }
# Download the latest deploy scripts
- mkdir deploy
- cd deploy
- wget -UseBasicParsing -O deploy-scripts-$Env:SOLSTA_SCRIPTS_VERSION.zip https://releases.snxd.com/deploy-scripts-$Env:SOLSTA_SCRIPTS_VERSION.zip
- Expand-Archive deploy-scripts-$Env:SOLSTA_SCRIPTS_VERSION.zip -DestinationPath .
# Generate console credential file from env vars
- echo "{""consoleCredentials"":{""audience"":""https://axis.snxd.com/"",""clientId"":""$Env:SOLSTA_CLIENT_ID"",""clientSecret"":""$Env:SOLSTA_CLIENT_SECRET"",""grant"":""clientCredentials"",""scope"":""d4tv1""}}" | out-file -encoding ASCII client_credentials.json
# Create the python venv in the deploy directory
- if (!(Test-Path -Path venv)) { python -m venv venv }
# Activate the new python environment
- venv\Scripts\activate
# Install any missing deploy script dependencies
- pip install -r requirements.txt
# Download the latest SSN Console Tools if necessary
- if (!(Test-Path -Path $Env:SOLSTA_CONSOLE_DIR$Env:SOLSTA_CONSOLE_VERSION/console)) { python direct_get.py --overwrite --version=$Env:SOLSTA_CONSOLE_VERSION --component=console --target_directory=$Env:SOLSTA_CONSOLE_DIR$Env:SOLSTA_CONSOLE_VERSION --console_credentials=client_credentials.json }
# Run the script that promotes a release to a new repository
- python manifest_promote.py --debug --console_credentials=client_credentials.json --console_directory=$Env:SOLSTA_CONSOLE_DIR$Env:SOLSTA_CONSOLE_VERSION/console --source_product_name=$Env:SOLSTA_SOURCE_PRODUCT --source_env_name=$Env:SOLSTA_SOURCE_ENV --source_repository_name=$Env:SOLSTA_SOURCE_REPOSITORY --process_default=API --product_name=$Env:SOLSTA_PROMOTE_TARGET_PRODUCT --env_name=$Env:SOLSTA_PROMOTE_TARGET_ENV --repository_name=$Env:SOLSTA_PROMOTE_TARGET_REPOSITORY
variables:
SOLSTA_SOURCE_PRODUCT: llamcraft
SOLSTA_SOURCE_ENV: dev-nightly
SOLSTA_SOURCE_REPOSITORY: game-client
SOLSTA_CONSOLE_VERSION: 6.1.2.84
SOLSTA_SCRIPTS_VERSION: 3.7.30
SOLSTA_CONSOLE_DIR: "/home/gitlab-runner/direct/"
SOLSTA_PROMOTE_TARGET_PRODUCT: llamcraft
SOLSTA_PROMOTE_TARGET_ENV: qa-internal
SOLSTA_PROMOTE_TARGET_REPOSITORY: game-client
image: maven:3.3.9-jdk-8
stages: [promote]
promote:jdk8:
stage: promote
script:
# Remove the old deploy script directory
- echo "SSN Promote Script Version 2"
- if [ -d "deploy" ]; then rm -Rf deploy; fi
# Download the latest deploy scripts
- mkdir deploy
- cd deploy
- wget https://releases.snxd.com/deploy-scripts-$SOLSTA_SCRIPTS_VERSION.zip
- unzip deploy-scripts-$SOLSTA_SCRIPTS_VERSION.zip
# Generate console credential file from env vars
- echo "{\"consoleCredentials\":{\"audience\":\"https://axis.snxd.com/\",\"clientId\":\"$SOLSTA_CLIENT_ID\",\"clientSecret\":\"$SOLSTA_CLIENT_SECRET\",\"grant\":\"clientCredentials\",\"scope\":\"d4tv1\"}}" > client_credentials.json
# Create the python venv in the deploy directory
- if [ ! -f "venv" ]; then python3 -m venv venv ; fi
# Activate the new python environment
- source venv/bin/activate
# Install any missing deploy script dependencies
- pip install -r requirements.txt
# Download the latest SSN Console Tools if necessary
- if [ ! -d "$SOLSTA_CONSOLE_DIR$SOLSTA_CONSOLE_VERSION/console" ]; then python direct_get.py --overwrite --version=$SOLSTA_CONSOLE_VERSION --target_directory=$SOLSTA_CONSOLE_DIR$SOLSTA_CONSOLE_VERSION --component=console --console_credentials=client_credentials.json ; fi
# Run the script that promotes a release to a new repository
- python manifest_promote.py --debug --console_credentials=client_credentials.json --console_directory=$SOLSTA_CONSOLE_DIR$SOLSTA_CONSOLE_VERSION/console --source_product_name=$SOLSTA_SOURCE_PRODUCT --source_env_name=$SOLSTA_SOURCE_ENV --source_repository_name=$SOLSTA_SOURCE_REPOSITORY --process_default=API --product_name=$SOLSTA_PROMOTE_TARGET_PRODUCT --env_name=$SOLSTA_PROMOTE_TARGET_ENV --repository_name=$SOLSTA_PROMOTE_TARGET_REPOSITORY
The configure Launch Files snippet manages which files are launched by the client for a specified environment. In the snippet below, custom CI/CD variables are defined for the following:
You can include as many launch entries as necessary for your environment. Each subsequent launch entry must follow the same variable format and be sequentially enumerated. See the example below for more details.
Upcoming article: How the Solsta Desktop Client handles launch entries
Launch Macros and macOS Executables
variables:
SOLSTA_LAUNCH_PRODUCT: plugins
SOLSTA_LAUNCH_ENV: gitlab-firstpass
SOLSTA_CONSOLE_VERSION: 6.1.2.84
SOLSTA_SCRIPTS_VERSION: 3.7.30
SOLSTA_CONSOLE_DIR: c:/temp/direct/
SOLSTA_LAUNCH_ENTRY1: Launch Game!
SOLSTA_LAUNCH_EXEC1: "{installDirectory}system/binaries/pyrogenesis.exe"
SOLSTA_LAUNCH_ARGS1: --debug --env=dev
SOLSTA_LAUNCH_ENTRY2: macOS Sample
SOLSTA_LAUNCH_EXEC2: /usr/bin/open
SOLSTA_LAUNCH_ARGS2: "{installDirectory}game_prereq.pkg"
SOLSTA_LAUNCH_ENTRY3: Third Entry
SOLSTA_LAUNCH_EXEC3: third.exe
SOLSTA_LAUNCH_ARGS3: arg1 arg2 arg3
.shared_windows_runners:
tags:
- shared-windows
- windows
- windows-1809
stages: [launchfiles]
launchfiles:jdk8:
extends:
- .shared_windows_runners
stage: launchfiles
script:
- echo "SSN Launch Files Script Version 2"
# Install Chocolatey, in order to install python3 and dotnet6
- iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
- $Env:PATH="$Env:PATH;$Env:ALLUSERSPROFILE/chocolatey/bin/"
- choco.exe install -y python3
- choco.exe install -y dotnet-6.0-sdk
- $Env:PATH = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
# Remove the old deploy script directory
- if (Test-Path -Path deploy) { rm -r -fo deploy }
# Download the latest deploy scripts
- mkdir deploy
- cd deploy
- wget -UseBasicParsing -O deploy-scripts-$Env:SOLSTA_SCRIPTS_VERSION.zip https://releases.snxd.com/deploy-scripts-$Env:SOLSTA_SCRIPTS_VERSION.zip
- Expand-Archive deploy-scripts-$Env:SOLSTA_SCRIPTS_VERSION.zip -DestinationPath .
# Generate console credential file from env vars
- echo "{""consoleCredentials"":{""audience"":""https://axis.snxd.com/"",""clientId"":""$Env:SOLSTA_CLIENT_ID"",""clientSecret"":""$Env:SOLSTA_CLIENT_SECRET"",""grant"":""clientCredentials"",""scope"":""d4tv1""}}" | out-file -encoding ASCII client_credentials.json
# Create the python venv in the deploy directory
- if (!(Test-Path -Path venv)) { python -m venv venv }
# Activate the new python environment
- venv\Scripts\activate
# Install any missing deploy script dependencies
- pip install -r requirements.txt
# Download the latest SSN Console Tools if necessary
- if (!(Test-Path -Path $Env:SOLSTA_CONSOLE_DIR$Env:SOLSTA_CONSOLE_VERSION/console)) { python direct_get.py --overwrite --debug_network --version=$Env:SOLSTA_CONSOLE_VERSION --component=console --target_directory=$Env:SOLSTA_CONSOLE_DIR$Env:SOLSTA_CONSOLE_VERSION --console_credentials=client_credentials.json }
# Add all launch file arguments
- $SOLSTA_EXTRA = ,""
- $i = 1
- $SOLSTA_LAUNCH_ENTRY = ( [System.Environment]::GetEnvironmentVariable("SOLSTA_LAUNCH_ENTRY$i") )
- >
while ( $SOLSTA_LAUNCH_ENTRY.Length -gt 0 ) { ;
$SOLSTA_LAUNCH_EXEC = ( [System.Environment]::GetEnvironmentVariable("SOLSTA_LAUNCH_EXEC$i") ) ;
$SOLSTA_LAUNCH_ARGS = ( [System.Environment]::GetEnvironmentVariable("SOLSTA_LAUNCH_ARGS$i") ) ;
$SOLSTA_EXTRA += "--launch_name=$SOLSTA_LAUNCH_ENTRY" ;
$SOLSTA_EXTRA += "--launch_executable=$SOLSTA_LAUNCH_EXEC" ;
$SOLSTA_EXTRA += "--launch_arguments=$SOLSTA_LAUNCH_ARGS" ;
$i = $i + 1 ;
$SOLSTA_LAUNCH_ENTRY = ( [System.Environment]::GetEnvironmentVariable("SOLSTA_LAUNCH_ENTRY$i") ) ;
} ;
# Run the script that adds the launch files entry to the environment
- python manifest.py --debug_network --console_credentials=client_credentials.json --console_directory=$Env:SOLSTA_CONSOLE_DIR$Env:SOLSTA_CONSOLE_VERSION/console --product_name=$Env:SOLSTA_LAUNCH_PRODUCT --env_name=$Env:SOLSTA_LAUNCH_ENV --object=launch --task=set $SOLSTA_EXTRA
variables:
SOLSTA_LAUNCH_PRODUCT: plugins
SOLSTA_LAUNCH_ENV: gitlab-firstpass
SOLSTA_CONSOLE_VERSION: 6.1.2.84
SOLSTA_SCRIPTS_VERSION: 3.7.30
SOLSTA_CONSOLE_DIR: "/Users/macos/direct/"
SOLSTA_LAUNCH_ENTRY1: Launch Game!
SOLSTA_LAUNCH_EXEC1: "{installDirectory}system/binaries/pyrogenesis.exe"
SOLSTA_LAUNCH_ARGS1: --debug --env=dev
SOLSTA_LAUNCH_ENTRY2: macOS Sample
SOLSTA_LAUNCH_EXEC2: /usr/bin/open
SOLSTA_LAUNCH_ARGS2: "{installDirectory}game_prereq.pkg"
SOLSTA_LAUNCH_ENTRY3: Third Entry
SOLSTA_LAUNCH_EXEC3: third.exe
SOLSTA_LAUNCH_ARGS3: arg1 arg2 arg3
image: python
stages: [launchfiles]
launchfiles:jdk8:
stage: launchfiles
script:
# Remove the old deploy script directory
- echo "SSN Launch Files Script Version 2"
- if [ -d "deploy" ]; then rm -Rf deploy; fi
# Download the latest deploy scripts
- mkdir deploy
- cd deploy
- wget https://releases.snxd.com/deploy-scripts-$SOLSTA_SCRIPTS_VERSION.zip
- unzip deploy-scripts-$SOLSTA_SCRIPTS_VERSION.zip
# Generate console credential file from env vars
- echo "{\"consoleCredentials\":{\"audience\":\"https://axis.snxd.com/\",\"clientId\":\"$SOLSTA_CLIENT_ID\",\"clientSecret\":\"$SOLSTA_CLIENT_SECRET\",\"grant\":\"clientCredentials\",\"scope\":\"d4tv1\"}}" > client_credentials.json
# Create the python venv in the deploy directory
- if [ ! -f "venv" ]; then python3 -m venv venv ; fi
# Activate the new python environment
- source venv/bin/activate
# Install any missing deploy script dependencies
- pip install -r requirements.txt
# Download the latest SSN Console Tools if necessary
- if [ ! -d "$SOLSTA_CONSOLE_DIR$SOLSTA_CONSOLE_VERSION/console" ]; then python direct_get.py --overwrite --version=$SOLSTA_CONSOLE_VERSION --target_directory=$SOLSTA_CONSOLE_DIR$SOLSTA_CONSOLE_VERSION --component=console --console_credentials=client_credentials.json ; fi
# Add all launch file arguments
- export SOLSTA_EXTRA=""
- i=1
- VARNAME=SOLSTA_LAUNCH_ENTRY$i
- SOLSTA_LAUNCH_ENTRY=${!VARNAME}
- |-
while [ "$SOLSTA_LAUNCH_ENTRY" != "" ] ; do
VARNAME=SOLSTA_LAUNCH_EXEC$i ;
SOLSTA_LAUNCH_EXEC=${!VARNAME} ;
VARNAME=SOLSTA_LAUNCH_ARGS$i ;
SOLSTA_LAUNCH_ARGS=${!VARNAME} ;
SOLSTA_EXTRA="$SOLSTA_EXTRA --launch_name=\"$SOLSTA_LAUNCH_ENTRY\" --launch_executable=\"$SOLSTA_LAUNCH_EXEC\" --launch_arguments=\"$SOLSTA_LAUNCH_ARGS\" " ;
i=$((i+1)) ;
VARNAME=SOLSTA_LAUNCH_ENTRY$i ;
SOLSTA_LAUNCH_ENTRY=${!VARNAME} ;
done ;
# Add any extra arguments
- if [[ $(tr "[:upper:]" "[:lower:]" <<<"$SOLSTA_DRY_RUN" ) = "true" ]];then SOLSTA_EXTRA="$SOLSTA_EXTRA --dry_run" ; fi
# Run the script that adds the launch files entry to the environment
- eval "python manifest.py --debug_network --console_credentials=client_credentials.json --console_directory=$SOLSTA_CONSOLE_DIR$Env:SOLSTA_CONSOLE_VERSION/console --product_name=\"$SOLSTA_LAUNCH_PRODUCT\" --env_name=\"$SOLSTA_LAUNCH_ENV\" --object=launch --task=set $SOLSTA_EXTRA"
Let us know what build system you are using.
"*" indicates required fields