Testing from a fork
Run a script from your own fork or branch, locally or from a URL, with or without a core branch.
A ct/ script loads two things: the engine from core and its install script from the repository it belongs to. The two are resolved independently, so you can test a script branch against the released engine, an engine branch against released scripts, or both together.
| Variable | Points at | Default |
|---|---|---|
COMMUNITY_SCRIPTS_URL | Raw base URL of the script repository (ct/, install/) | ProxmoxVE main; DevScripts scripts set DevScripts main through _CS_DEFAULT_URL |
COMMUNITY_SCRIPTS_CORE_URL | Raw base URL of the engine | core main |
COMMUNITY_SCRIPTS_CORE_DIR | A local core checkout | A core directory next to the script repository, if there is one |
core/build.func implements this. Source origin describes the resolution in detail.
Fork and branch
Fork the repository that owns the change: DevScripts for a new script, ProxmoxVE for a fix.
git clone https://github.com/YOUR_USERNAME/DevScripts
cd DevScripts
git switch -c add-myappDo not edit URLs inside a script to point it at your fork. The variables above exist so the files you commit are identical to the files you tested.
From a pushed branch
This is what a reviewer does, and what the "PR test command" comment on your pull request shows. Run it in the Proxmox VE shell or on an Incus host:
export COMMUNITY_SCRIPTS_URL=https://raw.githubusercontent.com/YOUR_USERNAME/DevScripts/add-myapp
bash -c "$(curl -fsSL "$COMMUNITY_SCRIPTS_URL/ct/myapp.sh")"Both lines are needed. With bash -c "$(curl ...)" there is no file on disk the engine could derive the script repository from. Without COMMUNITY_SCRIPTS_URL you would run the ct/ script from your branch and the install script from the default repository's main.
The container remembers where it came from: its update command pulls ct/myapp.sh from the same COMMUNITY_SCRIPTS_URL. So update inside a container built this way tests the update_script of your branch.
From a local checkout
Copy or clone your fork onto the host and run the file directly:
git clone https://github.com/YOUR_USERNAME/DevScripts
cd DevScripts
git switch add-myapp
bash ct/myapp.shThe engine finds the repository root by walking up from the script to the directory that contains ct/ and install/, and reads install/myapp-install.sh from there. Uncommitted changes are included, which makes this the fastest loop while you are still writing.
Two things to know:
- The engine itself still comes from core
mainunless a core checkout is found (next section). - If
gitis installed and a local core checkout was found, the engine setsCOMMUNITY_SCRIPTS_URLfrom the checkout'soriginremote and current branch (GitHub remotes only). Without a core checkout the default repository URL is used. That URL is what the container'supdatecommand uses later, so push the branch before you testupdateinside the container.
With a core branch
Local, with both checkouts side by side:
git clone https://github.com/YOUR_USERNAME/core
git clone https://github.com/YOUR_USERNAME/DevScripts
cd DevScripts
bash ct/myapp.shThe second line of every ct/ script looks for ../../core/core/build.func relative to itself, which is a core directory next to the script repository. Set COMMUNITY_SCRIPTS_CORE_DIR if your core checkout is somewhere else.
Remote, by adding the engine URL:
export COMMUNITY_SCRIPTS_URL=https://raw.githubusercontent.com/YOUR_USERNAME/DevScripts/add-myapp
export COMMUNITY_SCRIPTS_CORE_URL=https://raw.githubusercontent.com/YOUR_USERNAME/core/my-core-branch
bash -c "$(curl -fsSL "$COMMUNITY_SCRIPTS_URL/ct/myapp.sh")"core also ships a small runner, tools/run.sh, that sets both variables from its arguments and then runs the script. Its arguments are the script base, the script path and, optionally, the core base:
curl -fsSL https://raw.githubusercontent.com/community-scripts/core/main/tools/run.sh |
bash -s -- https://raw.githubusercontent.com/YOUR_USERNAME/DevScripts/add-myapp ct/myapp.shUseful while testing
dev_mode takes a comma-separated list of flags. Three are worth knowing for script work:
| Flag | Effect |
|---|---|
net | Logs every fetch with status, duration and URL. The quickest way to confirm that your branch is really being used. |
keep | Does not delete the container when the build fails, so you can look inside. |
timing | Shows how long each step took. |
export COMMUNITY_SCRIPTS_URL=https://raw.githubusercontent.com/YOUR_USERNAME/DevScripts/add-myapp
dev_mode=net,keep bash -c "$(curl -fsSL "$COMMUNITY_SCRIPTS_URL/ct/myapp.sh")"Dev mode lists all flags.
To build without the menu, as the automated test does, set mode=default:
export COMMUNITY_SCRIPTS_URL=https://raw.githubusercontent.com/YOUR_USERNAME/DevScripts/add-myapp
mode=default bash -c "$(curl -fsSL "$COMMUNITY_SCRIPTS_URL/ct/myapp.sh")"If the install stops at a prompt in that mode, the automated test will fail at the same place. See Coding rules for how to make a prompt answerable.
What to test before opening the pull request
- A fresh install with the default settings.
- The address the script prints at the end answers in a browser.
updateinside the container, right after the install. It must report that nothing is to do, or update cleanly.- If you changed
update_scriptof an existing script: install frommain, then update with your branch, as a user who installed before your change would. The container's/usr/bin/updatecarries the URL it was built from in anexport COMMUNITY_SCRIPTS_URL=line. Point that line at your branch inside the container and runupdate; this is what the automated upgrade test does:
sed -i -E 's#^export COMMUNITY_SCRIPTS_URL=.*#export COMMUNITY_SCRIPTS_URL="https://raw.githubusercontent.com/YOUR_USERNAME/ProxmoxVE/fix-myapp"#' /usr/bin/update
updateThe container keeps pulling from your branch afterwards, so use a throwaway container for this.