Skip to main content

Register pipeline

Manifest file format

name = ""               # Pipeline name
git_remote_url = "" # Git remote repository url
git_target_branch = "" # Git branch
git_tag_regex = "" # Git tag regex to trigger. (optional)
test_commands = [] # Test commands
build_commands = [] # Build commands
binaries = [] # Binary files to install.

[[systemd_services]]
name = "" # systemd unit service name
description = "" # Pipeline sample (optional)
exec_start_pre = "" # Command to execute before `exec_start`.
exec_start = "" # Command to start application.
opt_files = [""] # Files and directories required to run the application.
port = 0 # Port to listen. (optional)

[[systemd_services.etc]]
target = "" # Path of configuration file or directory.
content = "" # Contents of the configuration file. (optional)
option = "" # CLI option name to speficy file or directory.

[[systemd_services.env]]
name = "" # Environment variable name
value = "" # Environment variable value

.

KeyTypeDescriptionRequired
namestringPipeline name✔️
git_remote_urlstringGit remote repository url✔️
git_target_branchstringGit branch✔️
git_tag_regexstringGit tag regex to trigger
test_commandsstring[]Test commands
build_commandsstring[]Build commands
binariesstring[]Binary files to install.
systemd_servicessystemd_service[]Configuration of applications to run over systemd.

systemd_service

KeyTypeDescriptionRequired
namestringsystemd unit service name✔️
descriptionstringsystemd unit service description
exec_start_prestringCommand to execute before exec_start.
exec_startstringCommand to start application.✔️
opt_filesstring[]Files and directories required to run the application.
(Relative path from the repository root.)
etcetc_option[]Configuration files and directories containing them to load with CLI options when the application is run.
portint
(1 ~ 65535)
Port to listen.
envenv[]Envinronment variables required to run the application.

etc_option

KeyTypeDescriptionRequired
targetstringFile or directory path
(Relative path from the repository root.)
✔️
contentstringContent of the configuration file.
(If specified, creates the file instead of copying a file.)
optionstringCLI option to be specified at run time.✔️

env

KeyTypeDescriptionRequired
namestringEnvironment variable name✔️
valuestringEnvironment variable value✔️

Samples

Go

name = "workspace-go"
git_remote_url = "https://github.com/tingtt/workspace-go.git"
git_target_branch = "main"
git_tag_regex = "v*"
build_commands = ["/usr/bin/go build"]
binaries = ["workspace-go"]

[[systemd_services]]
name = "workspace-go"
description = "Sample go project"
exec_start = "workspace-go"
args = "--port 80"
port = 80

[[systemd_services.etc]] # This will run `./workspace-go --port 80 -f workspace-go.yml`
target = "workspace-go.yml"
option = "-f"

Next.js (standalone)

name = "systemd-cd-frontend"
git_remote_url = "https://github.com/tingtt/systemd-cd-frontend.git"
git_target_branch = "main"
git_tag_regex = "v*"
build_commands = [
"/root/.local/share/pnpm/pnpm install",
"""cat << EOF > .env.local # Rewrite host
NEXT_PUBLIC_API_URL=http://<systemd-cd-host>:1323/
EOF""",
"/root/.local/share/pnpm/pnpm build",
"cp -r .next/static .next/standalone/.next/static",
"cp -r public .next/standalone"
]

[[systemd_services]]
name = "systemd-cd-frontend"
description = "systemd-cd frontend with Next.js"
exec_start = "/usr/bin/node .next/standalone/server.js"
opt_files = [".next/standalone/"]
port = 3000

[[systemd_services.env]]
name = "PORT"
value = "3000"