Solsta GitLab CI Integration

The GitLab CI/CD YAML examples below outline how to use the Solsta deployment tools, scripts and API service to deploy and promote releases within the Solsta ecosystem. Deploying consists of converting and uploading raw files (assets) to a bucket in order to make releases available for download by Solsta desktop clients. There are also samples for configuring launch files within an environments, and cleaning up a bucket after deleting releases. These sample YAML snippets are meant to demonstrate a basic deployment and promotion using the Solsta deployment tools. You can modify these snippets as necessary to fit your GitLab CI/CD deployment pipeline. 

Article updated February 20th, 2023 for script examples version 2 or later. 

Runner/Executor Requirements

In order to perform Solsta deployments, Runners on your GitLab CI/CD instance will need to have the following components installed:

  • .NET 6.0
  • Python 3.9+
  • Linux runners also require the python3-venv package

Authentication

The Solid State Networks deployment tools require authentication using M2M credentials that were provided when your company signed up for Solsta. Contact your company’s primary contact with Solid State Networks or open a support ticket for assistance.
 
The YAML examples below require the credentials to be set as two environment variables before executing a pipeline.
  • SOLSTA_CLIENT_ID
  • SOLSTA_CLIENT_SECRET

 

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). 

YAML Deploy Examples

In the deployment examples below, custom CI/CD variables are defined for the following:
  • SOLSTA_PRODUCT: Target product for deployment
  • SOLSTA_ENV: Target environment within containing product
  • SOLSTA_REPOSITORY:  Target repository within containing environment
  • SOLSTA_RELEASE_VERSION: An environment variable or build parameter to use as a version within Solsta (optional)
  • SOLSTA_CONSOLE_VERSION: Version of the Solsta deployment tools. Do not change this unless instructed to do so by Solsta support staff.
  • SOLSTA_SCRIPTS_VERSION: Version of the Solsta deployment scripts. Do not change this unless instructed to do so by Solsta support staff.
  • SOLSTA_CONSOLE_DIR: Path on Runner machine(s) to save the Solsta deployment tools
  • SOLSTA_DEPLOY_SOURCE_PATH: Relative path to folder within build checkout directory. The contents of the folder and its directory structure will be deployed. You can also specify a full path to the source files, provided the agent running this step has access to it.

 

As part of the deployment process, the script downloads the latest Solsta deployment tools (if they are not already available) into a local directory on the runner specified by SOLSTA_CONSOLE_DIR. Next, it deploys (uploads) your build assets to your Solsta bucket. If the specified product, environment and repository do not exist, they will be automatically created.

Replace the echo lines
To use this basic Solsta deployment sample, replace the echo lines in the script section of the YAML below with the scripts and processes that build or compile your release. As mentioned above, you can use this YAML within your pipeline to best suite your needs. The Solsta deployment tools only need to be pointed to the path containing your cooked, ready-to-deploy data (or build artifacts). This can be done by editing the value of the SOLSTA_DEPLOY_SOURCE_PATH variable. Note that the runner executing the pipeline needs to have access to the files in that path.

Example:

SOLSTA_DEPLOY_SOURCE_PATH: s3://mybucket/mybuilds/v38.1.2/

How to Manage Files from Multiple Repositories in the Same Environment

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

  • game client
  • game server
  • dev tools
  • high-resolution assets

 

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. 

Windows Powershell Deployment Example

				
					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
				
			

Linux/macOS Deploy Example

				
					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
				
			

YAML Promote Examples

In the promote examples below, custom CI/CD variables are defined for the following:
  • SOLSTA_SOURCE_PRODUCT: Source product for promotion
  • SOLSTA_SOURCE_ENV: Source environment within containing product
  • SOLSTA_SOURCE_REPOSITORY: Source repository within containing environment
  • SOLSTA_CONSOLE_VERSION: Version of the Solsta deployment tools. Do not change this unless instructed to do so by Solsta support staff.
  • SOLSTA_SCRIPTS_VERSION: Version of the Solsta deployment scripts. Do not change this unless instructed to do so by Solsta support staff.
  • SOLSTA_CONSOLE_DIR: Path on Runner machine(s) to save the Solsta deployment tools.
  • SOLSTA_PROMOTE_TARGET_PRODUCT: Target product for promotion
  • SOLSTA_PROMOTE_TARGET_ENV: Target environment within containing product
  • SOLSTA_PROMOTE_TARGET_REPOSITORY: Target repository within containing environment
 
As part of the promotion process, the script will check for and download the Solsta deployment tools if necessary, then execute the manifest_promote script to promote a release from a source Product, Environment and Repository to a target Product, Environment and Repository. If the target environment has an update path count value greater than zero, the runner will automatically create delta update paths within the target Environment and Repository as part of the promotion step.

Windows Powershell Promote Example

				
					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
				
			

Linux/macOS Promote Example

				
					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
				
			

YAML Launch Files Example

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:

  • SOLSTA_LAUNCH_PRODUCT: Product containing the environment to be configured (case-sensitive)
  • SOLSTA_LAUNCH_ENV: Environment to configure Launch Files for (case-sensitive)
  • SOLSTA_CONSOLE_VERSION: Version of the Solsta deployment tools. Do not change this unless instructed to do so by Solsta support staff.
  • SOLSTA_SCRIPTS_VERSION: Version of the Solsta deployment scripts. Do not change this unless instructed to do so by Solsta support staff.
  • SOLSTA_CONSOLE_DIR: Path on Runner machine(s) to save the Solsta deployment tools.
  • SOLSTA_LAUNCH_ENTRY1: Friendly name of the first launch entry. This will appear as a button on the Solsta Desktop Application UI. 
  • SOLSTA_LAUNCH_EXEC1: Path to the file to launch associated with the first launch entry. 
  • SOLSTA_LAUNCH_ARGS1: Arguments to use when launching the file specified in the first launch entry. 

 

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. 

Related: How Launch Buttons Work in the Solsta Desktop Application

Launch Macros and macOS Executables

  • Note that if the file being launched is in a sub-directory from the root of where the environment is installed, you will need to prepend the file path with the {installDirectory} macro. Example: “{installDirectory}system/binaries/GameClient.exe”
  • To launch a file that is not an application directory on macOS, use /usr/bin/open as the File Path and “{installDirectory}name_of_file.pkg” in the Arguments field.

Windows Powershell Launch Files Example

				
					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
				
			

Linux/macOS Launch Files Example

				
					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"
Copy