This action handles the setup and teardown of a RavenDB database.
See action.yml
steps:
- name: Setup RavenDB
uses: Particular/[email protected]
with:
single-connection-string-name: <my connection string name for the single node>
cluster-connection-string-name: <my connection string name for the cluster nodes>
ravendb-license: <Single Line JSON License String>
ravendb-version: <RavenDB Container Tag Name>
ravendb-mode: <RavenDB Server Mode>
tag: <my tag>The scripts and documentation in this project are released under the MIT License.
Open the folder in Visual Studio Code. If you don't already have them, you will be prompted to install remote development extensions. After installing them, and re-opening the folder in a container, do the following:
Log into Azure
az login
az account set --subscription SUBSCRIPTION_IDRun the npm installation
npm installWhen changing index.js, either run npm run dev beforehand, which will watch the file for changes and automatically compile it, or run npm run prepare afterwards.
To test the setup action add a new .env.setup file in the root directory with the following content
# Input overrides
INPUT_SINGLE_CONNECTION-STRING-NAME=RavenDBConnectionString
INPUT_CLUSTER_CONNECTION-STRING-NAME=RavenDBClusterConnectionString
INPUT_RAVENDB_LICENSE=...
INPUT_WHATEVER_ELSE_YOU_NEED_TO_OVERRIDE=...
INPUT_TAG=setup-ravendb-action
# Runner overrides
# Use LINUX to run on Linux
RUNNER_OS=WINDOWS
RESOURCE_GROUP_OVERRIDE=yourResourceGroup
REGION_OVERRIDE=West Europethen execute the script
node -r dotenv/config dist/index.js dotenv_config_path=.env.setupTo test the cleanup action add a .env.cleanup file in the root directory with the following content
# State overrides
STATE_IsPost=true
STATE_containerName=nameOfPreviouslyCreatedContainer
STATE_ravenMode=nameOfPreviouslyUsedModenode -r dotenv/config dist/index.js dotenv_config_path=.env.cleanupTo test the setup action set the required environment variables and execute setup.ps1 with the desired parameters.
$Env:RUNNER_OS=Windows
$Env:RESOURCE_GROUP_OVERRIDE=yourResourceGroup
$Env:REGION_OVERRIDE=yourResourceGroup
.\setup.ps1 -ScriptDirectory . -ContainerName psw-ravendb-1 -SingleConnectionStringName RavenDBConnectionString -ClusterConnectionStringName RavenDBConnectionString -RavenDBLicense 'SingleLineJSON' -RavenDBVersion "6.2" -RavenDBMode "Single" -Tag setup-ravendb-actionTo test the cleanup action set the required environment variables and execute cleanup.ps1 with the desired parameters.
$Env:RUNNER_OS=Windows
.\cleanup.ps1 -ScriptDirectory . -ContainerName psw-ravendb-1 -RavenDBMode "Single"