ci: Pi-hole DNS, npm/nuget cache, serial low-RAM builds
continuous-integration/drone/push Build is failing
continuous-integration/drone/push Build is failing
Use LAN Traefik DNS, persist package caches under /drone-cache, and keep api→shop→admin serial with single workers for the 2GiB limit. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
17393dba5e
commit
4e2756eee5
1 file changed
+21
-8
+21
-8
@@ -4,11 +4,8 @@
|
|||||||
# ssh_port — optional, default 22
|
# ssh_port — optional, default 22
|
||||||
# deploy_path — absolute path on host (e.g. /opt/iled-shop)
|
# deploy_path — absolute path on host (e.g. /opt/iled-shop)
|
||||||
#
|
#
|
||||||
# First-time host setup:
|
# Homelab runner: Pi-hole DNS → Traefik LAN; /drone-cache for npm/nuget.
|
||||||
# git clone ssh://git@git.zea.lt:2222/miczek/iled-shop.git $DEPLOY_PATH
|
# Steps stay serial + single-worker so builds fit under DRONE_MEMORY_LIMIT (~2GiB).
|
||||||
# cd $DEPLOY_PATH/docker && cp .env.example .env # then edit secrets
|
|
||||||
#
|
|
||||||
# Pi note: steps serialize workers so builds fit under DRONE_MEMORY_LIMIT (~2GiB).
|
|
||||||
|
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
@@ -18,6 +15,9 @@ platform:
|
|||||||
os: linux
|
os: linux
|
||||||
arch: arm64
|
arch: arm64
|
||||||
|
|
||||||
|
dns:
|
||||||
|
- 192.168.0.64
|
||||||
|
|
||||||
clone:
|
clone:
|
||||||
depth: 50
|
depth: 50
|
||||||
|
|
||||||
@@ -27,10 +27,15 @@ concurrency:
|
|||||||
steps:
|
steps:
|
||||||
- name: api
|
- name: api
|
||||||
image: mcr.microsoft.com/dotnet/sdk:10.0
|
image: mcr.microsoft.com/dotnet/sdk:10.0
|
||||||
|
pull: false
|
||||||
environment:
|
environment:
|
||||||
# One MSBuild node; disable node reuse — lower peak RAM on 4GB Pi
|
|
||||||
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
|
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
|
||||||
|
DOTNET_NOLOGO: "1"
|
||||||
MSBUILDDISABLENODEREUSE: "1"
|
MSBUILDDISABLENODEREUSE: "1"
|
||||||
|
NUGET_PACKAGES: /drone-cache/nuget
|
||||||
|
NUGET_HTTP_CACHE_PATH: /drone-cache/nuget-http
|
||||||
|
DOTNET_CLI_HOME: /drone-cache/dotnet
|
||||||
|
NUGET_XMLDOC_MODE: skip
|
||||||
commands:
|
commands:
|
||||||
- cd src/backend
|
- cd src/backend
|
||||||
- dotnet restore iLED.slnx
|
- dotnet restore iLED.slnx
|
||||||
@@ -38,24 +43,28 @@ steps:
|
|||||||
|
|
||||||
- name: shop
|
- name: shop
|
||||||
image: node:22-bookworm
|
image: node:22-bookworm
|
||||||
|
pull: false
|
||||||
environment:
|
environment:
|
||||||
NG_BUILD_MAX_WORKERS: "1"
|
NG_BUILD_MAX_WORKERS: "1"
|
||||||
NODE_OPTIONS: "--max-old-space-size=1536"
|
NODE_OPTIONS: "--max-old-space-size=1536"
|
||||||
|
npm_config_cache: /drone-cache/npm
|
||||||
commands:
|
commands:
|
||||||
- cd src/shop
|
- cd src/shop
|
||||||
- npm ci
|
- npm ci --prefer-offline
|
||||||
- npm run build -- --configuration=production
|
- npm run build -- --configuration=production
|
||||||
depends_on:
|
depends_on:
|
||||||
- api
|
- api
|
||||||
|
|
||||||
- name: admin
|
- name: admin
|
||||||
image: node:22-bookworm
|
image: node:22-bookworm
|
||||||
|
pull: false
|
||||||
environment:
|
environment:
|
||||||
NG_BUILD_MAX_WORKERS: "1"
|
NG_BUILD_MAX_WORKERS: "1"
|
||||||
NODE_OPTIONS: "--max-old-space-size=1536"
|
NODE_OPTIONS: "--max-old-space-size=1536"
|
||||||
|
npm_config_cache: /drone-cache/npm
|
||||||
commands:
|
commands:
|
||||||
- cd src/admin
|
- cd src/admin
|
||||||
- npm ci
|
- npm ci --prefer-offline
|
||||||
- npm run build -- --configuration=production
|
- npm run build -- --configuration=production
|
||||||
depends_on:
|
depends_on:
|
||||||
- shop
|
- shop
|
||||||
@@ -75,6 +84,9 @@ platform:
|
|||||||
os: linux
|
os: linux
|
||||||
arch: arm64
|
arch: arm64
|
||||||
|
|
||||||
|
dns:
|
||||||
|
- 192.168.0.64
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- ci
|
- ci
|
||||||
|
|
||||||
@@ -87,6 +99,7 @@ concurrency:
|
|||||||
steps:
|
steps:
|
||||||
- name: ssh-deploy
|
- name: ssh-deploy
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
|
pull: false
|
||||||
settings:
|
settings:
|
||||||
host:
|
host:
|
||||||
from_secret: ssh_host
|
from_secret: ssh_host
|
||||||
|
|||||||
Reference in new issue
Block a user