ajuste no drone.yml

This commit is contained in:
Marcus Bohessef 2025-12-11 23:34:37 -03:00
parent 794e4fb343
commit 5ede17efad
2 changed files with 7 additions and 24 deletions

View file

@ -3,38 +3,29 @@ type: kubernetes
name: deploy-backend
steps:
# -----------------------------------------------------------
# BUILD & PUSH PARA O HARBOR
# -----------------------------------------------------------
# BUILD & PUSH para Harbor
- name: build-and-push-backend
image: plugins/docker:latest
environment:
DOCKER_USERNAME:
from_secret: HARBOR_USERNAME
DOCKER_PASSWORD:
from_secret: HARBOR_PASSWORD
settings:
registry: in.gohorsejobs.com
repo: gohorsejobs/gohorsejobs-backend
tags:
- latest
context: backend
dockerfile: backend/Dockerfile
insecure: true
insecure_skip_verify: true
insecure: true # Use apenas se necessário (HTTP ou certificado self-signed)
insecure_skip_verify: true # Use apenas se necessário
debug: true
mtu: 0
# -----------------------------------------------------------
# DEPLOY NO K3S
# -----------------------------------------------------------
# DEPLOY no K3S
- name: deploy-backend
image: bitnami/kubectl:latest
environment:
KUBERNETES_SERVER:
from_secret: K3S_SERVER
@ -44,10 +35,8 @@ steps:
from_secret: K3S_CLIENT_CERT
KUBERNETES_CLIENT_KEY:
from_secret: K3S_CLIENT_KEY
commands:
- mkdir -p ~/.kube
- |
cat <<EOF > ~/.kube/config
apiVersion: v1
@ -70,7 +59,6 @@ steps:
namespace: gohorsejobs
current-context: drone-context
EOF
- echo "Deploying backend..."
- kubectl apply -f k8s/backend-deployment.yaml
- kubectl apply -f k8s/backend-service.yaml
- kubectl apply -f k8s/backend-service.yaml

View file

@ -13,24 +13,19 @@ spec:
metadata:
labels:
app: gohorse-backend
# Se quiser ativar Infisical Sidecar, descomente abaixo
# Para usar Infisical Sidecar, descomente as linhas abaixo:
# annotations:
# infisical.com/managed: "true"
# infisical.com/secret-path: "prod/backend"
spec:
containers:
- name: backend
image: in.gohorsejobs.com/gohorsejobs/gohorsejobs-backend:latest
imagePullPolicy: Always
ports:
- containerPort: 3000
env:
- name: NODE_ENV
value: "production"
imagePullSecrets:
- name: harbor-registry
- name: harbor-registry