This commit is contained in:
47
.drone.yml
47
.drone.yml
@@ -1,47 +1,10 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: deploy to k3s
|
name: test
|
||||||
|
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- custom
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: setup docker
|
- name: hello
|
||||||
image: docker:dind
|
image: alpine
|
||||||
commands:
|
commands:
|
||||||
- docker login -u admin -p admin localhost:5000
|
- echo "✅ Drone CI/CD is working!"
|
||||||
|
- date
|
||||||
- name: build backend
|
|
||||||
image: node:22-alpine
|
|
||||||
commands:
|
|
||||||
- npm install -g pnpm
|
|
||||||
- cd apps/backend
|
|
||||||
- pnpm install --frozen-lockfile
|
|
||||||
- docker build -t localhost:5000/backend:latest .
|
|
||||||
- docker push localhost:5000/backend:latest
|
|
||||||
|
|
||||||
- name: build frontend
|
|
||||||
image: node:22-alpine
|
|
||||||
commands:
|
|
||||||
- npm install -g pnpm
|
|
||||||
- cd apps/frontend
|
|
||||||
- pnpm install --frozen-lockfile
|
|
||||||
- docker build --build-arg API_BASE=http://backend-service:3001 -t localhost:5000/frontend:latest .
|
|
||||||
- docker push localhost:5000/frontend:latest
|
|
||||||
|
|
||||||
- name: deploy to k3s
|
|
||||||
image: rancher/kubectl
|
|
||||||
commands:
|
|
||||||
- kubectl rollout restart deployment/backend
|
|
||||||
- kubectl rollout restart deployment/frontend
|
|
||||||
|
|
||||||
services:
|
|
||||||
- name: docker
|
|
||||||
image: docker:dind
|
|
||||||
privileged: true
|
|
||||||
environment:
|
|
||||||
DOCKER_TLS_CERTDIR: ""
|
|
||||||
|
|||||||
Reference in New Issue
Block a user