Jenkins打包
Tests / Test No test results found

This commit is contained in:
2026-07-13 10:42:31 +08:00
parent e9006c3a29
commit 52dae806ef
6 changed files with 229 additions and 7 deletions
+20
View File
@@ -59,6 +59,26 @@ migrations, then starts the API on port `8001`. Readiness is available at:
GET http://127.0.0.1:8001/health/ready
```
## Deploying A Jenkins-Built Image
`docker compose up --build` above builds the image from source on the target
host. For environments that pull a pre-built image instead, `Jenkinsfile` runs
the pytest suite (`-m "not integration"`), builds the image from the same
`Dockerfile`, smoke-tests both console scripts (`device-cloud-api --help`,
`device-host-agent --help`), and pushes `<REGISTRY>/<IMAGE_NAME>:<BUILD_NUMBER>-<git short sha>`
plus `:latest` to the configured registry.
`compose.deploy.yaml` is the same three-service stack as `compose.yaml`
except `cloud-api` and `host-agent` reference `image:` instead of `build:`.
Set `REGISTRY`, `IMAGE_NAME`, and `IMAGE_TAG` (see `.env.example`) to the tag
Jenkins published, then deploy without a local build step:
```bash
docker compose -f compose.deploy.yaml pull
docker compose -f compose.deploy.yaml up -d
docker compose -f compose.deploy.yaml ps
```
For a deployment that manages processes outside Compose, apply migrations
before starting the new Cloud API version: