Ferdigheter · Apper
Deploy an app
Publish a web app on Skybu from files, an uploaded folder or a Git repository, and get its address back.
Skybu builds the app in an isolated virtual machine, runs it on its own address under skybu.app, and keeps the previous version serving if the new one fails. You need a project to put the app in.
In short
list_projectsto find the project, orcreate_projectto make one.- Ask the user what data the app handles (its data class) and, if
list_departmentsreturns any, which department owns it. Never guess these. - Send the files with
deploy_files(small apps), orcreate_upload+deploy_upload(larger ones). - Follow the build with
get_deploymentuntil it islive, then give the user the address.
Step 1: the project
{ "name": "list_projects", "arguments": {} }
Each project lists its apps, databases and file storage with their ids. If the user has no suitable project, create one:
{ "name": "create_project", "arguments": { "name": "kundeportal" } }
Step 2: what the app is for
A new app needs a dataClass, one of:
| Value | When |
|---|---|
none | No data about people or the business: a demo, a public page. |
internal | Business data that is not about individuals. |
personal | Names, emails, phone numbers or other data about people. |
sensitive | Health, religion, national identity numbers and other special categories. |
Ask the user. If you think the app touches personal data, say so; never pick a lower class to get past a question. If the organisation has departments, department is required too. owner defaults to the signed-in user.
Step 3: send the files
The app's name is 2–31 lowercase letters, digits and hyphens. It becomes part of the address, https://<app>.<org>.skybu.app.
{
"name": "deploy_files",
"arguments": {
"projectId": "<project id>",
"name": "kundeportal",
"dataClass": "internal",
"files": [
{ "path": "package.json", "content": "{ \"name\": \"kundeportal\", \"scripts\": { \"start\": \"node server.js\" } }" },
{ "path": "server.js", "content": "…" },
{ "path": "public/logo.png", "content": "<base64>", "encoding": "base64" }
]
}
}
- Send every file the build needs: source,
package.jsonand its lockfile,requirements.txt, and aDockerfileif the app has one. Leave outnode_modules, build output and.envfiles. - Without a Dockerfile, Skybu detects the language and framework and builds it (Railpack). With one, it uses it.
- The app must listen on the port in the
PORTenvironment variable. - Binary files go as base64 with
"encoding": "base64".
For more than a few MB, upload a .tar.gz of the folder instead:
{ "name": "create_upload", "arguments": { "projectId": "<project id>", "name": "kundeportal" } }
PUT the archive to the returned address (Content-Type: application/gzip, at most 50 MB, within an hour), then:
{ "name": "deploy_upload", "arguments": { "uploadId": "<upload id>", "dataClass": "internal" } }
To deploy from GitHub or GitLab instead, so every push deploys, use create_app_from_git (see skill://apps/deploy-from-git).
Step 4: follow the build
Both deploy tools return a deployment. Poll it:
{ "name": "get_deployment", "arguments": { "deploymentId": "<deployment id>" } }
| Status | Meaning |
|---|---|
queued, building, deploying | Still working. Check again in a few seconds. |
awaiting_approval | Built, and the organisation requires an owner to approve production changes. Tell the user; agents cannot approve. |
live | Serving. Give the user the address. |
failed | The build or the start failed. The previous version keeps serving. See skill://apps/fix-a-failed-deploy. |
The log is live while the build runs, so you can show the user progress.
Things to know
- Deploying again to the same name makes a new version of the same app. The old one serves until the new one is up.
rollback_appreturns to an earlier version in a couple of seconds.- Variables the app needs (API keys, settings) are set with
set_env_varsbefore or after the first deploy (skill://apps/environment-variables). - The project's database address is already in
DATABASE_URLwhen the project has a database (skill://databases/use-the-database).