-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
31 lines (25 loc) · 1023 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
# Define phony targets (targets that don't create files)
.PHONY: all install format lint
# Default target that runs all tasks
all: install format lint
# Install required dependencies and create necessary directories
install:
@echo "Installing..."
mkdir -p ~/mlflow/artifacts
mkdir -p ~/mlflow/db
apt-get install -y curl shellcheck yamllint docker-compose wget
# Download shfmt and make it executable
wget https://github.com/mvdan/sh/releases/download/v3.7.0/shfmt_v3.7.0_linux_arm64 -O /usr/local/bin/shfmt
chmod +x /usr/local/bin/shfmt
# Format shell scripts using shfmt
format:
@echo "Formatting shell scripts..."
shfmt -l -w -i 4 *.sh
# Lint shell scripts and YAML files
lint:
@echo "Checking shell scripts..."
shellcheck *.sh
@echo "Checking YAML files..."
find . -name "*.yml" -o -name "*.yaml" -exec yamllint -f parsable {} \;
@echo "Validating docker-compose..."
docker-compose -f services/docker-compose.yml config 2>&1 | grep -v "variable is not set. Defaulting to a blank string" || exit $?