TeamCity
The CLI doesn't read TeamCity's parameters by itself: pass them as environment variables. Add a password parameter env.VISUALCI_TOKEN with a project token, and these to the build configuration:
| Parameter | Value |
|---|---|
env.VISUALCI_COMMIT |
%build.vcs.number% |
env.VISUALCI_BRANCH |
%teamcity.build.branch% |
env.VISUALCI_PR |
%teamcity.pullRequest.number% (with the Pull Requests build feature) |
Then a command-line step:
curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.5 VISUALCI_INSTALL_DIR="$PWD/bin" sh
export PATH="$PWD/bin:$PATH"
export VISUALCI_BUILD_ID=$(visualci build create)
npm test -- -u # write snapshots instead of failing; see the snapshot guides
visualci upload --from auto src tests
visualci build finalize
Without the Pull Requests build feature, set env.VISUALCI_PR to false.
See Other CI providers for the environment variables and how shards work.