-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (29 loc) · 882 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.PHONY: all build run clean
# Name of the Docker image
DOCKER_REPO := mmaous
IMAGE_NAME := sftp
TAG := v1.0.0
# envs used to run transfer
X_HOST=$(HOST)
X_PORT=$(PORT)
X_VM_USERNAME=$(VM_USERNAME)
X_VM_PASSWORD=$(VM_PASSWORD)
X_LOCAL_FOLDER_PATH=$(LOCAL_FOLDER_PATH)
X_REMOTE_FOLDER_PATH=$(REMOTE_FOLDER_PATH)
# Build the Docker image
docker-build:
docker build -t $(DOCKER_REPO)/$(IMAGE_NAME):$(TAG) .
# Run the Docker container with environment variables
docker-run:
docker run --rm \
-e HOST=$(X_HOST) \
-e PORT=$(X_PORT) \
-e VM_USERNAME=$(X_VM_USERNAME) \
-e VM_PASSWORD=$(X_VM_PASSWORD) \
-e LOCAL_FOLDER_PATH=/sftp-data \
-e REMOTE_FOLDER_PATH=$(X_REMOTE_FOLDER_PATH) \
-v /$(X_LOCAL_FOLDER_PATH):/sftp-data \
$(DOCKER_REPO)/$(IMAGE_NAME):$(TAG)
# Clean up Docker images and containers
docker-push:
docker push $(DOCKER_REPO)/$(IMAGE_NAME):$(TAG)