CControxity Docs
GuidesReferenceHTTP APIOpen Controxity
Start here

Every place, step by step

Add where your product runs (a server, a web page, an Android or iOS app), connect it, and choose how each new version gets there, with what each screen shows.

A place is one thing that runs your product and reports to Controxity: a server, a web page, an app in Google Play or the App Store. Each place has a key, a part of the product it runs, and a way new versions get to it. This page walks through all of them with the screens you'll see. Everything is done on the page; the only commands are one line each, to copy, for what runs on your own machines.

The pictures show a made-up shop, Basket, with a server (basket-api), a web shop (basket.example) and a phone app on both stores.

Before you start#

1. Add the place#

Open the product, then Where it runs → Add a place it runs:

Press Add.

Add a place it runs: production, What is it?, Part, Name, then Add
Add a place it runs: production, What is it?, Part, Name, then Add

The place's key is shown once. A server key starts with dep_: it stays on your server and never goes in a page or an app.

The key, shown once, with Controxity's address: copy both into the server's environment
The key, shown once, with Controxity's address: copy both into the server's environment

Lost it? The place's Setup has New key (the old one stops at once).

2. Follow its Setup#

Under the places, Setup lists what each place still needs, in order. A step done in Controxity is a button; a step done on your machine is one line with Copy. Each step ticks itself when Controxity sees it done, and Today shows any place that isn't set up yet, with Finish setup.

A server#

A server's setup: its key and the SDK, its version, how new versions get there
A server's setup: its key and the SDK, its version, how new versions get there
  1. Put its key where it runs, and start the SDK. Put the two lines in the server's .env (or environment). The SDK is one file, kept with your code:
curl -fsSL https://controxity.example.com/sdk/node.js -o controxity.js

Use your Controxity's address. Then start it as early as the server starts: see Node.js or Python. The step ticks when the server first reports.

  1. Say which version it runs. The SDK reads CONTROXITY_VERSION, or the file controxity deploy writes when the helper deploys. It ticks when a version arrives.
  2. Choose how a new version gets there. Press Our team does it to keep deploying as you do now, or Controxity's helper does it. The other ways are in step 3 below.
  3. With the helper: Run the helper on the server. One line, in the product's folder on the server. It installs the helper as a service that asks Controxity for work every minute, with the key from the app's .env.
With the helper: the one line that installs it, with Copy
With the helper: the one line that installs it, with Copy

A web page#

A page gets a browser key (pub_): it can only send, so it's safe in a page.

A web page's setup: Make a browser key gives the two lines for the page
A web page's setup: Make a browser key gives the two lines for the page
  1. Put the browser SDK in the page. Press Make a browser key, then copy the two lines into your HTML, before your own scripts. The SDK loads from your Controxity. It ticks when the page first reports. More: Browser.
  2. Say which version the page is, in that init line: your build's version or git commit.
  3. Choose how a new version gets there, as for a server.

An Android app#

An Android place's first step: who makes each new version
An Android place's first step: who makes each new version
  1. Choose who makes each new version. Controxity's helper does it (it builds each version on a machine you choose), or Our team does it (Controxity sees the version when phones report it).
  2. Say how phones get it. Read from your code: an app without expo-updates (or EAS Update) gets store builds, one with it over-the-air updates. Press the other button if that's wrong. See the next section.
  3. Run the helper where the app is built. Press Make the install command: it gives the place a new key and makes one line with it and your build command (scripts/build-play.sh or scripts/build-android.sh when you have one). Run it on the machine that builds the app (yours, a build server, any machine with the app's toolchain), in its git checkout. It needs no access to GitHub or GitLab: when it can't fetch a version's commit from them, it gets it from Controxity's copy of the code with its key. The helper keeps that key in a file only you can read. The helper keeps itself up to date: when Controxity has a newer helper, it takes it between jobs by itself. To move it to another machine, press Make the install command again (in Setup, or Make the install command under How new versions get there) and run the new line there. Each build's file (.aab, .apk, .ipa) is sent to Controxity, so anyone on the team downloads it from Releases, from any computer: nothing has to be fetched from the build machine.
The install command, with the place's new key (shown once) and the build command
The install command, with the place's new key (shown once) and the build command
  1. Send the app's crashes through your server. No key goes in the app: it posts its crashes to your own server, which passes them on with controxity.captureClient(...). See Phone apps.
  2. Tell Controxity which version phones run, with controxity.clientVersion(...) on your server. Then a fix shows as running on phones, not only shipped.
  3. Optional: Google Play's own crash reports (crashes only Google sees). A read-only service account, then Product settings → Phone and desktop → Google Play. They come in on this place.

An iOS app#

The same steps as Android, without Google Play. Where the helper runs depends on how the app is built:

Either way the .ipa comes to Controxity: download it from Releases and upload it in App Store Connect (or send it to TestFlight from there). If the app has over-the-air updates, the same helper publishes them for iPhones too: your update script gets CONTROXITY_PLATFORM=ios.

A new iPhone place's last two steps (crashes, versions) tick when an iPhone first uses the app: open your TestFlight build once. Until then the place isn't shown as not connected, since its helper asks for work every minute.

An iOS app with its own scripts/build-ios.sh: the helper runs on a Mac with Xcode (an app built on EAS needs no Mac)
An iOS app with its own scripts/build-ios.sh: the helper runs on a Mac with Xcode (an app built on EAS needs no Mac)

3. How a new version gets there#

Each place gets new versions one way, chosen under How new versions get there (or with the Setup buttons). Whichever way, a version counts as there once the place reports it: Controxity never guesses.

WayChoose it whenWhat it needs
The team deploys itYou deploy as you do now (by hand, your own CI, your host).Nothing. Releases shows "deployed by its team" until the place reports the version.
Helper on the serverYou want Deploy in Controxity to deploy it, on a server you run.One line on the server (Setup gives it). It runs the deploy: command from controxity.yml in a clean copy of the exact commit, waits for deploy: health:, and goes back if it isn't healthy. See Deploy.
GitHub Actions workflowYour deploy already lives in GitHub Actions.A workflow in the product's repository (Download a starting workflow), its file name and branch, and Controxity's GitHub App with Actions: Read and write. Controxity starts it with the version, commit and place, and follows its run.
GitLab pipelineYour code is on a connected GitLab and deploys with a pipeline.The branch. Controxity starts a pipeline with CONTROXITY_ID, CONTROXITY_VERSION, CONTROXITY_COMMIT and CONTROXITY_PLACE; your .gitlab-ci.yml runs its deploy job when they're set. The project must let Developers use pipeline variables (Settings → CI/CD → Variables).
Deploy webhookYour host deploys from a hook (most platforms have one).The hook's https:// address. Controxity posts {id, app, place, version, commit, repository}, signed: check the X-Controxity-Signature header (sha256= HMAC of the body with the secret shown once when you save).
Deploy command, run hereControxity runs on the same machine as the product (not on a shared server).The deploy: command for that channel in controxity.yml: Controxity runs it itself.
Helper on the server: connected or not, Download the helper, New key for it
Helper on the server: connected or not, Download the helper, New key for it
GitHub Actions workflow: its file and branch, Save, and a starting workflow to download
GitHub Actions workflow: its file and branch, Save, and a starting workflow to download
Deploy webhook: the hook's address, then Save
Deploy webhook: the hook's address, then Save
Deploy command, run here: the production command from controxity.yml
Deploy command, run here: the production command from controxity.yml

The GitLab pipeline is offered only for a product whose code comes from a connected GitLab, and Deploy command, run here only when controxity.yml has a command for that channel.

Phones: updates, store builds, or both#

A phone place gets each version one of three ways, chosen next to the way it's deployed (Setup chooses it from your code):

The helper runs where the app is built, with its signing key, and gets the commands its way needs: --update (your publish command, scripts/publish-update.sh when you have one, told "Version $CONTROXITY_VERSION") and --build (your store build, scripts/build-play.sh or scripts/build-android.sh, scripts/build-ios.sh for iOS, or an EAS build). Both run in the helper's own copy of the exact commit, never in your working folder, with CONTROXITY_VERSION, CONTROXITY_COMMIT and CONTROXITY_PLATFORM set, your .env and Firebase files copied in and the app's packages installed. Make the install command puts both in the one line. What each step does, and what a store build's app.json gets: Phone apps.

Your server first. When phones get their updates from your own server, Releases lists it as step 1, and each phone place as step 2, disabled until the server runs the version. Send to a phone place early and the version goes to the server first; the phones' turn comes by itself. A new phone place waits for the same server as the product's other phone place.

A store build's file (.aab, .apk, .ipa, and installers such as .dmg or .msi) is sent to Controxity: download it from Releases and upload it in Play Console or App Store Connect. The helper looks for the files the build just made in the build's own copy of the code, and for any file the build's output names by its full path (Ready: /home/me/builds/app-1.2.6.aab); if your build writes them somewhere else without saying where, add --files /path/to/builds to the install line. Each file can be up to 1 GB, and each place keeps the files of its last 3 builds. Behind a proxy with an upload limit (Cloudflare's is 100 MB on most plans), a bigger file stays on the build machine, and the helper says where.

Updates can roll out in stages (10% → 50% → 100%, stopped by itself when the new version looks worse). A store build's rollout is Play Console's or App Store Connect's.

4. Send a version#

Open Releases. The newest version lists each place that doesn't run it yet, with its button: Deploy to … for a server or a page, Build for Google Play… or Build for App Store… for a phone place with store builds. A place that runs it already isn't listed.

Releases: the newest version, and a button for each place that doesn't run it yet
Releases: the newest version, and a button for each place that doesn't run it yet

For a phone place with updates and store builds, the button is Send to Google Play… and Controxity chooses which. A production place asks for a yes first (Approvals), as your product's settings say. Then the place's line says how it's going:

A store build made: built, upload it to the store, and Download for its file
A store build made: built, upload it to the store, and Download for its file

A few things the line also says:

Pushed new code and want its version now? Releases → Get the latest code (Controxity also looks every 5 minutes).

Today shows what's left#

Until every place is set up, Today lists each one with its next step and Finish setup. They're tips: they don't change the product's health.

Today: each place's setup steps left, and its next step
Today: each place's setup steps left, and its next step

Where to go next#

Controxity 1.132.0These pages are in the repository: docs/site