ci: implements jenkins deploy

This commit is contained in:
2026-02-21 09:26:25 +01:00
parent b5c8364b47
commit dc6b143ec9
3 changed files with 116 additions and 0 deletions

33
Makefile Normal file
View File

@@ -0,0 +1,33 @@
APP_NAME=pablotj-portfolio-api
IMAGE_NAME=$(APP_NAME)
REGISTRY_URL=registry.pablotj.com
NAMESPACE=andromeda
TAG?=latest
HOST_PORT=8080
CONTAINER_PORT=3000
IMAGE_FULL=$(REGISTRY_URL)/$(NAMESPACE)/$(IMAGE_NAME):$(TAG)
build:
docker build -t $(IMAGE_NAME):$(TAG) .
tag:
docker tag $(IMAGE_NAME):$(TAG) $(IMAGE_FULL)
push:
docker push $(IMAGE_FULL)
run:
docker run -d \
--name $(APP_NAME) \
-p $(HOST_PORT):$(CONTAINER_PORT) \
--env-file .env \
$(IMAGE_FULL)
stop:
docker stop $(APP_NAME) || true
docker rm $(APP_NAME) || true
deploy: build tag push stop run