Skip to content

Commit

Permalink
feat: RESET_PIPELINES_DIR env var
Browse files Browse the repository at this point in the history
  • Loading branch information
tjbck committed Jun 2, 2024
1 parent fb7ffc9 commit 76ba2b4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
#!/usr/bin/env bash
PORT="${PORT:-9099}"
HOST="${HOST:-0.0.0.0}"
# Default value for PIPELINES_DIR
PIPELINES_DIR=${PIPELINES_DIR:-./pipelines}

# Function to reset pipelines
reset_pipelines_dir() {
if [ "$RESET_PIPELINES_DIR" = true ]; then
echo "Resetting pipelines directory: $PIPELINES_DIR"

# Check if the directory exists
if [ -d "$PIPELINES_DIR" ]; then
# Remove all contents of the directory
rm -rf "${PIPELINES_DIR:?}"/*
echo "All contents in $PIPELINES_DIR have been removed."

# Optionally recreate the directory if needed
mkdir -p "$PIPELINES_DIR"
echo "$PIPELINES_DIR has been recreated."
else
echo "Directory $PIPELINES_DIR does not exist. No action taken."
fi
else
echo "RESET_PIPELINES_DIR is not set to true. No action taken."
fi
}

# Example usage of the function
reset_pipelines_dir

# Function to install requirements if requirements.txt is provided
install_requirements() {
Expand Down

0 comments on commit 76ba2b4

Please sign in to comment.