ci: implements jenkins deploy
This commit is contained in:
33
Makefile
Normal file
33
Makefile
Normal file
@@ -0,0 +1,33 @@
|
||||
APP_NAME=pablotj-portfolio-web
|
||||
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
|
||||
Reference in New Issue
Block a user