Overview
Diarkis CLI allows you to execute a plethora of operations for Diarkis from the command-line interface including building your server binary.
- Building server binary with Diarkis Engine with your custom code.
Environment
- macOS, Linux
- Internet access
Installation
You may install Diarkis CLI by following the instructions below:
Manual Download
You may download CLI from this link. You must download CLI appropriate for your environment. After unpacking the downloaded CLI, you may place "bin/diarkis-cli" anywhere you like.
※For macOS, if you get an error with the message "Cannot open the file...", you need to follow the steps below:
System Preferences > Security and Privacy > General > Open Anyway
How To Use
diarkis-cli is used with a subcommand and optional flag(s)
$ diarkis-cli [subcommand] [flags]
Optional Flags
There are global flags (independent of the subcommand used) and flags specific to the subcommand used.
You may look up the global flags with diarkis-cli --help under "Global Flags:".
Subcommand specific flags are listed under "Flags"
Subcommands
Subcommand build
subcommand "build" is used to build Diarkis server binary. The subcommand interacts with Diarkis Build Server over the internet to build your Diarkis server binary.
The following are the steps of build overview:
1. Authenticates the license with Diarkis Build Server
2. Transport local server source code to Diarkis Build Server
3. Resolve and install go modules and build the server source code with Diarkis on Diarkis Build Server
4. Download the built binary to the local machine
build.yml
CLI build uses "build.yml" as its configurations for the build process.
buildSettings:
# Specify build target directory
root: .
# Go version to be used for build
goVersion: 1.16.5
# Environment variables for the entire project
env:
GOOS: # If not used, the system environment variable will be used
GOARCH:
# Build project root
projects:
# Project name
udp:
# compile target source code to be handled over to go build
target: cmd/udp/main.go
# Build result binary
output: remote_bin/udp
# Environment variables for each project
env:
# ${PROJECT_DIR} will be the root when built
CGO_CFLAGS: -I${PROJECT_DIR}
CGO_LDFLAGS: -L${PROJECT_DIR} -Wl,-rpath,${PROJECT_DIR}
# Project name
http:
target: cmd/http/main.go
output: remote_bin/http
# Global configurations
diarkis:
# License authentication key
# The key will be issued when you buy the license
project_id: xxxxxxxxx
builder_token: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
build Command Help
Usage:
diarkis-cli build [flags]
Flags:
-c, --conf string config yaml (default "build.yml")
-h, --help help for build
-t, --targets string build target projects
Global Flags:
--builderToken string
--host string
--insecure
--port string (default "443")
--projectId string
--verbose