Skip to content

Build & Deploy from Source ​

Install or update wick (the wick-agent app) from source, at any branch or tag, with one command, the same way the normal installer works but without waiting for a release. On a fresh machine the script first installs what the build needs: Git, Go (the version wick's go.mod asks for) and the wick CLI, so nothing has to be set up by hand.

The same script also builds your own wick app (a project made with wick init) and its plugins from your repo: see Your own app.

For release builds (no Go needed) use the normal installer: Wick Agent quick install.

Install wick from source ​

bash
# branch master: install the first time, update (zero downtime) every time after
curl -fsSL https://yogasw.github.io/wick/deploy-from-source.sh | bash

# another branch or tag
curl -fsSL https://yogasw.github.io/wick/deploy-from-source.sh | bash -s -- --ref develop
powershell
# branch master: install the first time, update every time after
& ([scriptblock]::Create((iwr -useb https://yogasw.github.io/wick/deploy-from-source.ps1)))

# another branch or tag
& ([scriptblock]::Create((iwr -useb https://yogasw.github.io/wick/deploy-from-source.ps1))) -Ref develop

What it does:

  1. Clones https://github.com/yogasw/wick.git at --ref into ~/wick-src (later runs fetch and check out the ref again).
  2. Installs Go if it is missing or older than the source needs, and Node 20 if missing (/usr/local/node; %LOCALAPPDATA%\Programs\node on Windows).
  3. Generates what a branch does not carry in git but a release tag does: templ generate for the *_templ.go views, and the FE apps under fe/ (npm ci && npm run build). Then the wick CLI from that source (go install .).
  4. Scaffolds ~/wick-agent once with wick init wick-agent, the same scaffold the release builds, and points its go.mod at ~/wick-src.
  5. wick setup, sets the version to the source's next patch plus the build time (1.17.2.202610191030, so every build is newer than the release before it and than the previous build), wick build.
  6. Installs it the first time as a package (.deb on Linux, else /usr/local/bin; %LOCALAPPDATA%\Programs\wick-agent on Windows) and starts it. On Linux with systemd it becomes a user service (wick-agent service install): it starts at boot, and its unit runs with WICK_GRACEFUL_UPGRADE=1, which every later update needs for a zero-downtime reload.

To update, run the same command again. It fetches the newest commit of --ref. If the installed build already comes from that commit (recorded in ~/.wick-agent/built-commit) it only makes sure wick-agent is running and stops there; --force rebuilds anyway. Otherwise it rebuilds and swaps the build in: a zero-downtime reload when the daemon supports it, otherwise (a daemon started with a plain wick-agent start) stop / swap / start, which also moves it onto the service so the next update is zero-downtime. Windows always uses stop / swap / start.

wick-agent is the server, wick is the dev CLI

After the install, manage the server with wick-agent start | stop | status, and wick-agent service install to start it at boot. The web UI is on port 9425; the first admin login is in ~/.wick-agent/INITIAL_CREDENTIALS.txt. The wick command the script also installs is the developer CLI (wick build, wick init, …): wick server there means "run the project in the current folder" and fails outside one.

--src DIR, --dir DIR and --app NAME (-Src, -Dir, -App) change those locations.

Script URL before a release

yogasw.github.io/wick/… is published with the docs on every wick release. Until a release includes these scripts, use the raw files from a branch: https://raw.githubusercontent.com/yogasw/wick/master/scripts/deploy-from-source.sh (.ps1 for Windows; /develop/ for the newest version).

Your own app ​

For a project made with wick init, in its own repo:

bash
# fresh machine: Go + wick CLI, clone, build, install, plugins
curl -fsSL https://yogasw.github.io/wick/deploy-from-source.sh \
  | bash -s -- all --git https://github.com/org/myapp.git

# every update after that, from inside the checkout
cd ~/myapp && curl -fsSL https://yogasw.github.io/wick/deploy-from-source.sh | bash -s -- all
powershell
& ([scriptblock]::Create((iwr -useb https://yogasw.github.io/wick/deploy-from-source.ps1))) all -Git https://github.com/org/myapp.git

# every update after that, from inside the checkout
cd ~\myapp; & ([scriptblock]::Create((iwr -useb https://yogasw.github.io/wick/deploy-from-source.ps1))) all

Private repo: set a token first. It is sent as a header, never written to .git/config:

bash
curl -fsSL https://yogasw.github.io/wick/deploy-from-source.sh \
  | TOKEN=ghp_xxx bash -s -- all --git https://github.com/org/myapp.git
powershell
$env:TOKEN = 'ghp_xxx'
& ([scriptblock]::Create((iwr -useb https://yogasw.github.io/wick/deploy-from-source.ps1))) all -Git https://github.com/org/myapp.git

Add --dry-run (-DryRun on Windows) to print every step without changing anything.

LinuxmacOSWindows
Installs Git / Go / wick CLIapt, dnf or apk · Go in /usr/local/goHomebrew for Git · Go in /usr/local/gowinget for Git · Go in %LOCALAPPDATA%\Programs\Go (no admin)
First install.deb (dpkg -i), else /usr/local/bin/<app>/usr/local/bin/<app>%LOCALAPPDATA%\Programs\<app>\<app>.exe, added to your PATH
Updatezero-downtime reloadzero-downtime reloadstop, swap the .exe, start (Windows has no socket handover)

Commands ​

CommandWhat it does
wick (default)Build and install wick itself from source at --ref, see above.
setupInstalls git/curl/tar (apt, dnf or apk), Go into /usr/local/go when missing or older than go.mod needs, and the wick CLI at the version your app depends on.
coregit pull, bumps the patch version: in wick.yml, wick upgrade -y (latest wick release), go test, wick build, then installs the build (below).
pluginsBuilds and installs every plugin under plugins/{connector,tool,job,service}/<key>/ whose VERSION is newer than the installed one, or not installed yet. Name keys to force: plugins my_tool other_tool.
allsetup, core, plugins.
statusApp version and plugin list.

How core installs the build (Linux / macOS):

  • App already installed and running: <app> reload --binary bin/<app>-linux-<arch> --sudo -y --wait. The new binary is checked (same wick app, arch, newer version), swapped in atomically, takes over the listening socket while the old process finishes its in-flight work, and is rolled back if it never starts serving. The daemon needs WICK_GRACEFUL_UPGRADE=1 (set by the packaged systemd unit); without it the reload is refused and nothing changes. Rerun with --restart to stop, swap and start instead (a short downtime).
  • Not installed yet: installs the .deb from bin/ (Linux with dpkg) or copies the binary to /usr/local/bin/<app>. Start it with <app> start.

Plugins are hot-loaded by the running app; the script waits until plugin list shows the new version. A plugin is never downgraded, so one installed from another source with a higher version is left alone.

Flags ​

FlagDefault
--ref REFmasterwick: branch or tag to build
--src DIR~/wick-srcwick: source checkout
--dir DIRcurrent dir if it has wick.yml, else ~/<repo name>app checkout
--git URLclone into --dir when it is not there yet (https recommended)
--branch NAMErepo defaultbranch to clone / pull
--app NAMEname: in wick.ymlinstalled binary name
--wick DIRbuild against a local wick checkout (temporary go.mod replace, always restored)
--no-upgradekeep the wick version in go.mod
--no-pull / --no-bump / --no-testskip that step
--all-pluginsrebuild every plugin
--bump-pluginsbump each built plugin's VERSION patch first
--restartforce stop / swap / start even when a zero-downtime reload is possible
--no-installbuild only, leave the result in bin/
--forcewick: rebuild even when the installed build is from the newest commit
--dry-runprint, change nothing

On Windows the same flags are PowerShell switches: -Ref, -Src, -Dir, -Git, -Branch, -App, -Wick, -NoUpgrade, -NoPull, -NoBump, -NoTest, -AllPlugins, -BumpPlugins, -DryRun.

Build by hand ​

What the script runs, if you prefer the steps yourself:

bash
# 1. toolchain
curl -fsSL -o go.tgz https://go.dev/dl/go1.26.0.linux-amd64.tar.gz   # the version in go.mod
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go.tgz
export PATH=/usr/local/go/bin:$HOME/go/bin:$PATH
go install github.com/yogasw/wick@v1.18.1                          # the wick CLI

# 2. app
git clone https://github.com/org/myapp.git && cd myapp
wick upgrade -y                     # latest wick release into go.mod
wick build --target linux/amd64     # bin/myapp-linux-amd64 + bin/myapp-<ver>-linux-amd64.deb

# 3. install: first time / every update after that
sudo dpkg -i bin/myapp-*-linux-amd64.deb && myapp start
myapp reload --binary bin/myapp-linux-amd64 --sudo -y --wait

# 4. a plugin
cd plugins && GOWORK=off wick plugin build --kind tool my_tool --target linux/amd64
myapp plugin install bin/my_tool-0.1.0-linux-amd64.zip

Bump version: in wick.yml before every update: reload refuses a build that is not newer than the running one. GOWORK=off matters when the repo has a go.work; without it the plugin build fails with "-mod may only be set to readonly or vendor".

Shared build hosts ​

If the machine has a buildq command on PATH (a host-wide build queue), tests and builds run through it, one heavy job at a time; otherwise they run at low priority (nice).

Built with ❤️ by a developer, for developers.