Compare commits
16 Commits
0.0.2
...
a803759384
| Author | SHA1 | Date | |
|---|---|---|---|
| a803759384 | |||
| 1f65582e77 | |||
| 54cabc5f7f | |||
| 8760d61b22 | |||
| 1a2c725f6b | |||
| b346f02282 | |||
| 78271baba1 | |||
| 871b497ffa | |||
| 41e254f732 | |||
| 7ebdfede12 | |||
| bb7a2fd08e | |||
| 4058796b50 | |||
| 54d72b4d66 | |||
| d0d3a3deea | |||
| 7be8dc7bc2 | |||
| fdf23dd510 |
90
.drone.yml
Normal file
90
.drone.yml
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
# ARM64 platform (for your Pi runner)
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: arm64
|
||||||
|
|
||||||
|
workspace:
|
||||||
|
path: /drone/src
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Step 1a: Git fetch tags locally
|
||||||
|
- name: fetch-tags
|
||||||
|
image: docker:24
|
||||||
|
environment:
|
||||||
|
DOCKER_HOST: unix:///var/run/docker.sock # local Docker, if needed
|
||||||
|
commands:
|
||||||
|
- apk add --no-cache git
|
||||||
|
- git fetch --tags
|
||||||
|
- |
|
||||||
|
LATEST_TAG=$(git describe --tags --abbrev=0)
|
||||||
|
echo "Latest Git tag fetched: $LATEST_TAG"
|
||||||
|
# Save to file to share with next step
|
||||||
|
echo $LATEST_TAG > /drone/src/LATEST_TAG.txt
|
||||||
|
|
||||||
|
# Step 1b: Check if image exists on remote LAN Docker
|
||||||
|
- name: check-remote-image
|
||||||
|
image: docker:24
|
||||||
|
environment:
|
||||||
|
DOCKER_HOST: tcp://192.168.1.111:2376 # remote Docker
|
||||||
|
commands:
|
||||||
|
- IMAGE_TAG=$(cat /drone/src/LATEST_TAG.txt)
|
||||||
|
- echo "Checking if apps/homepage:$IMAGE_TAG exists on remote Docker..."
|
||||||
|
- |
|
||||||
|
if docker image inspect apps/homepage:$IMAGE_TAG > /dev/null 2>&1; then
|
||||||
|
echo "✅ Docker image apps/homepage:$IMAGE_TAG already exists — skipping build";
|
||||||
|
exit 78; # stop pipeline gracefully
|
||||||
|
else
|
||||||
|
echo "⚙️ Docker image apps/homepage:$IMAGE_TAG not found — proceeding to build...";
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Step 2: Build Docker image (dynamic tag)
|
||||||
|
- name: build-image
|
||||||
|
image: docker:24
|
||||||
|
environment:
|
||||||
|
DOCKER_HOST: tcp://192.168.1.111:2376
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
IMAGE_TAG=$(cat /drone/src/LATEST_TAG.txt)
|
||||||
|
if [ -z "$IMAGE_TAG" ]; then
|
||||||
|
echo "❌ No tag found in LATEST_TAG.txt — cannot build."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "🔨 Building Docker image apps/homepage:$IMAGE_TAG ..."
|
||||||
|
docker build --network=host -t apps/homepage:$IMAGE_TAG -t apps/homepage:latest
|
||||||
|
|
||||||
|
# Step 3: Stop old container (if exists)
|
||||||
|
- name: stop-old
|
||||||
|
image: docker:24
|
||||||
|
environment:
|
||||||
|
DOCKER_HOST: tcp://192.168.1.111:2376
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
echo "🛑 Stopping old container..."
|
||||||
|
docker rm -f homepage || true
|
||||||
|
|
||||||
|
# Step 4: Run container
|
||||||
|
- name: run-container
|
||||||
|
image: docker:24
|
||||||
|
environment:
|
||||||
|
DOCKER_HOST: tcp://192.168.1.111:2376
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
IMAGE_TAG=$(cat /drone/src/LATEST_TAG.txt)
|
||||||
|
echo "🚀 Starting container apps/homepage:$IMAGE_TAG ..."
|
||||||
|
docker run -d \
|
||||||
|
--name homepage \
|
||||||
|
-p 3001:3000 \
|
||||||
|
-e NODE_ENV=production \
|
||||||
|
apps/homepage:$IMAGE_TAG
|
||||||
|
|
||||||
|
# Trigger rules
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- tag
|
||||||
|
- custom
|
||||||
@@ -25,7 +25,7 @@ const services = {
|
|||||||
],
|
],
|
||||||
codebase: [
|
codebase: [
|
||||||
{ name: "Gitea", url: "http://gitea.aetoskia.com", desc: "Forge and safeguard code like a sacred relic.", external: true },
|
{ name: "Gitea", url: "http://gitea.aetoskia.com", desc: "Forge and safeguard code like a sacred relic.", external: true },
|
||||||
{ name: "DCR", url: "http://dcr.aetoskia.com", desc: "Monitor core constructs of the digital empire.", external: true },
|
{ name: "Registry", url: "http://registry.aetoskia.com", desc: "Monitor core constructs of the digital empire.", external: true },
|
||||||
{ name: "Drone", url: "http://drone.aetoskia.com", desc: "Automaton architect, building pipelines of perfection.", external: true },
|
{ name: "Drone", url: "http://drone.aetoskia.com", desc: "Automaton architect, building pipelines of perfection.", external: true },
|
||||||
],
|
],
|
||||||
monitoring: [
|
monitoring: [
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ services:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
# network: host
|
# network: host
|
||||||
container_name: homepage
|
container_name: homepage
|
||||||
image: apps/homepage:0.0.2
|
image: apps/homepage:0.0.5
|
||||||
ports:
|
ports:
|
||||||
- "3001:3000" # map host port 3000 to container
|
- "3001:3000" # map host port 3000 to container
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "material-ui-react-router-ts",
|
"name": "homepage",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user