Deploying
Command-line tool
Deploy an app and watch its build from your terminal, or from any CI, with one command.
Install
It needs Node.js 18.17 or newer, on Windows, macOS or Linux, and nothing else:
npm install -g https://oceanlaunch.cloud/cli/oceanlaunch-cli-0.1.0.tgz
oceanlaunch --version
The package's SHA-256 is bada5728ac0285480569a4580bffb21af295afe8638e84ec6e09f0e532d41e3f. To check
it first, download the file, compare its checksum (sha256sum, or Get-FileHash on
Windows), then install the downloaded file.
Sign in
- Make a token under Account → API tokens (see API tokens). Choose Read and deploy to deploy with it.
- Run
oceanlaunch loginand paste it. It isn't shown as you paste, and it's checked before it's saved.
The token is saved in a file only you can read (~/.config/oceanlaunch/config.json, or
%APPDATA%\oceanlaunch\config.json on Windows), together with the portal's address, and is only ever
sent there. oceanlaunch logout removes it from the file; revoke it under API tokens too if you no
longer need it.
The tool never takes a token on the command line, where it would end up in your shell history: paste it, pipe it
in, or set OCEANLAUNCH_TOKEN.
Commands
| Command | What it does |
|---|---|
oceanlaunch apps | The workspace's apps, their status and addresses. |
oceanlaunch status my-app | One app and its latest deployment, with the reason if it failed. |
oceanlaunch deploy my-app | Deploys the newest commit (or latest upload) and prints the build
log until it's live. --quiet prints only the result; --no-wait returns once it's queued. |
oceanlaunch logs my-app | The latest deployment's log. Add a number for an older one, and
--follow to keep printing until it finishes. |
oceanlaunch deployments my-app | Its recent deployments. |
oceanlaunch workspaces | Your workspaces and your role in each. |
oceanlaunch use my-workspace | Makes a workspace the default, so you can leave out -w. |
oceanlaunch whoami | Who the token belongs to and what it may do. |
With one workspace, it's used by itself. Otherwise pick one with -w my-workspace,
OCEANLAUNCH_WORKSPACE or oceanlaunch use. Add --json to any command for output
a script can read.
In CI
Save a Read and deploy token as a secret named OCEANLAUNCH_TOKEN; nothing needs to sign in. In
GitHub Actions, after your tests:
- name: Deploy to OceanLaunch
env:
OCEANLAUNCH_TOKEN: ${{ secrets.OCEANLAUNCH_TOKEN }}
run: |
curl -fsSLo oceanlaunch-cli.tgz https://oceanlaunch.cloud/cli/oceanlaunch-cli-0.1.0.tgz
echo "bada5728ac0285480569a4580bffb21af295afe8638e84ec6e09f0e532d41e3f oceanlaunch-cli.tgz" | sha256sum -c -
npx --yes --package ./oceanlaunch-cli.tgz oceanlaunch deploy my-app -w my-workspace --quiet
The checksum line makes the job stop if the file isn't exactly the published one, before anything runs with your
token. Keep --package … oceanlaunch as it is: without it, npx runs nothing and still
reports success.
deploy exits with 0 when the app is live and 3 when the deployment fails or is
cancelled, so the job fails with it. Other problems (a refused token, a mistyped app) exit with 1, and
a wrong command with 2.
How it keeps your token safe
- It only talks to the portal over HTTPS, and never follows a redirect, so the token can't be sent anywhere else.
- Build logs are printed without terminal control sequences, so a build can't change your terminal's title, move the cursor or hide lines.
- It has no dependencies to trust beyond Node.js itself.