louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
60.35k stars 5.4k forks source link

Improve the build process #5267

Closed louislam closed 4 weeks ago

louislam commented 4 weeks ago

Description

While trying to update the existing script to release the beta, I found that it is too hard to modify and read due to the length. So this PR try to convert to a better script which is written in JS.

Also add an ability to build with another image name.

Also fix the setup script which is not pointing to the latest version of v1.

Type of change

Checklist

louislam commented 4 weeks ago

Tested with dry run, seems to be fine.

Final:

> uptime-kuma@2.0.0-dev release-final
> node ./extra/release/final.mjs

Dry run enabled.
RELEASE_VERSION: 2.0.0
Checking if version 2.0.0 exists on Docker Hub
[DRY RUN] node extra/update-version.js
[DRY RUN] npm run build
[DRY RUN] docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:2-slim-rootless -t louislam/uptime-kuma:2.0.0-slim-rootless --target rootless --build-arg BASE_IMAGE=louislam/uptime-kuma:base2-slim . --push
[DRY RUN] docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:2-rootless -t louislam/uptime-kuma:2.0.0-rootless --target rootless . --push
[DRY RUN] docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:next-slim -t louislam/uptime-kuma:2-slim -t louislam/uptime-kuma:2.0.0-slim --target release --build-arg BASE_IMAGE=louislam/uptime-kuma:base2-slim . --push
[DRY RUN] docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:next -t louislam/uptime-kuma:2 -t louislam/uptime-kuma:2.0.0 --target release . --push
Git Push and Publish the release note on github, then press any key to continue
[DRY RUN] npm run upload-artifacts
[DRY RUN] node extra/update-wiki-version.js

Beta:

> uptime-kuma@2.0.0-dev release-beta
> node ./extra/release/beta.mjs

Dry run enabled.
RELEASE_BETA_VERSION: 2.0.0-beta.0
Semver identifier: [ 'beta', 0 ]
Checking if version 2.0.0-beta.0 exists on Docker Hub
[DRY RUN] node ./extra/beta/update-version.js
[DRY RUN] npm run build
[DRY RUN] docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:beta-slim-rootless -t louislam/uptime-kuma:2.0.0-beta-slim-rootless.0 --target rootless --build-arg BASE_IMAGE=louislam/uptime-kuma:base2-slim . --push
[DRY RUN] docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:beta-rootless -t louislam/uptime-kuma:2.0.0-beta-rootless.0 --target rootless . --push
[DRY RUN] docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:beta-slim -t louislam/uptime-kuma:2.0.0-beta-slim.0 --target release --build-arg BASE_IMAGE=louislam/uptime-kuma:base2-slim . --push
[DRY RUN] docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:beta -t louislam/uptime-kuma:2.0.0-beta.0 --target release . --push
Git Push and Publish the release note on github, then press any key to continue
[DRY RUN] npm run upload-artifacts