removed old bash scripts

This commit is contained in:
2025-10-24 12:16:01 -07:00
parent 08d52cac38
commit 32a175f272
28 changed files with 1 additions and 913 deletions
+1 -31
View File
@@ -4,7 +4,7 @@
👤 Author: [Nick Yeoman](https://www.nickyeoman.com/).
These cookbooks are created with the intent of using Docker's extend feature. This way, you can run multiple containers in different domains but still have only one file to update.
Production ready docker compose files
## 🤔 Assumptions
@@ -22,34 +22,4 @@ The intended workflow is as follows:
You will likely want to override a number of things in the project folder, such as networks.
## 🔍 Example Result
Here is an example of how your project's docker-compose file might look:
```yaml
services:
proxy:
extends:
file: ${COOKBOOK}/nginx-proxy-manager/docker-compose.yml
service: proxy
env_file:
- .env
networks:
- proxy
networks:
proxy:
external: true
```
with the .env file:
```text
COOKBOOK=/docker-compose-cookbooks
COMPOSE_PROJECT_NAME=www-4lt-ca
TZ=America/Vancouver
VOL_CONFIG_PATH=/websites/www-4lt-ca/config
VOL_PATH=/websites/www-4lt-ca/data
```
Now use ```docker compose up -d``` to start the project.
-27
View File
@@ -1,27 +0,0 @@
#!/bin/bash
process_env_vars() {
local env_vars="$1" # Accept the environment variables as the first parameter
local APP_NAME="$(echo "$2" | tr '[:lower:]' '[:upper:]')" # Convert app name to uppercase
local results=() # Array to collect results
# Loop through each environment variable
while IFS= read -r env_var; do
# Split into name and value parts based on ':'
var_name="${env_var%%:*}" # Variable name
var_value="${env_var#*:}" # Variable value
# Remove leading and trailing whitespace
var_name=$(echo "$var_name" | xargs)
var_value=$(echo "$var_value" | xargs)
# Format the variable as required
modified_var="${var_name}=\${${APP_NAME}_${var_name}:-${var_value}}"
# Append the modified variable to results
results+=("$modified_var")
done <<< "$env_vars"
# Output the results joined with new lines
printf "%s\n" "${results[@]}" | sort
}
-15
View File
@@ -1,15 +0,0 @@
#!/bin/bash
# Function to parse and handle the variable
extract_image_name() {
local dirty_img="$1"
if [[ "$dirty_img" == *\$* ]]; then
extracted_value=$(echo "$dirty_img" | sed -n 's/.*:-\([^}]*\)}.*/\1/p')
else
extracted_value=$dirty_img
fi
echo "$extracted_value"
}
-21
View File
@@ -1,21 +0,0 @@
#!/bin/bash
BLDR_IMAGE_VAR="\${${BLDR_APP^^}_IMAGE:-$BLDR_DC_IMAGE}"
# Generate Docker Compose content and save it to a variable
BLDR_NEW_DCF=$(cat <<EOF
version: '3.8'
services:
$BLDR_APP:
image: $BLDR_IMAGE_VAR
restart: unless-stopped
environment:
$(echo "$BLDR_DC_ENV" | sed 's/^/ - /')
volumes:
$(echo "$BLDR_DC_VOLS" | sed 's/^/ - /')
EOF
)
# Print the variable to verify the content
echo "$BLDR_NEW_DCF" > ${BLDR_DIR}/docker-compose.yml
-44
View File
@@ -1,44 +0,0 @@
#!/bin/bash
# Function to process volumes
process_volumes() {
local volumes="$1" # Accept volumes as the first parameter
local results=() # Array to collect results
# Loop through each volume
while IFS= read -r volume; do
# Perform actions with each volume
if [[ "$volume" == *\$* ]]; then
if [[ "$volume" == *'VOL'* && "$volume" == *'PATH'* ]]; then
results+=("$volume")
else
part="${volume#*\}}/" # Note the \} to handle the literal }
part="${part#./}"
part="${part#/}"
results+=('${VOL_PATH:-./data}/'"$part")
fi
else
if [[ "${volume:0:1}" == '/' ]]; then
results+=("$volume")
else
if [[ "$volume" == './data'* ]]; then
part="${volume#./data}"
part="${part#/}"
results+=('${VOL_PATH:-./data}/'"$part")
elif [[ "$volume" == './config'* ]]; then
part="${volume#./config}"
part="${part#/}"
results+=('${VOL_CONFIG_PATH:-./config}/'"$part")
else
part="${volume#./}"
results+=("./$part")
fi
fi
fi
# Add your commands here to handle each volume
done <<< "$volumes"
# Output the results joined with new lines
printf "%s\n" "${results[@]}" | sort
}
-8
View File
@@ -1,8 +0,0 @@
#!/bin/bash
debug_print_helper_variables() {
echo "DEBUGGING $(date +%s): "
for var in $(compgen -v | grep '^BLDR_'); do
echo "$var=${!var}"
done
}
-18
View File
@@ -1,18 +0,0 @@
#!/bin/bash
# Define the content to write to the file
file_content=$(cat <<EOF
version: '3.4'
services:
$BLDR_APP:
extends:
file: \${COOKBOOK}/$BLDR_APP/docker-compose.yml
service: $BLDR_APP
EOF
)
# Output the content to a file
BLDR_NEW_SE="$file_content"
echo "$BLDR_NEW_SE" > ${BLDR_DIR}/sample-extends.yml
-17
View File
@@ -1,17 +0,0 @@
#!/bin/bash
# List all directories in the current directory that don't start with an underscore
directories=$(find . -maxdepth 1 -type d -not -name '_*' -exec basename {} \; | grep -v '[_\.]' | sort -r)
# Use fzf to allow the user to select a directory
selected_dir=$(echo "$directories" | fzf --prompt="Select a directory: ")
# Check if a directory was selected
if [[ -z "$selected_dir" ]]; then
echo "No directory selected."
return 1
fi
# Set the BLDR_DIR variable to the selected directory
BLDR_DIR="${BLDR_PARENT_PATH}/${selected_dir}"
BLDR_APP=${selected_dir}
-19
View File
@@ -1,19 +0,0 @@
#!/bin/bash
# Check if BLDR_DIR is set
if [[ -z "$BLDR_DIR" ]]; then
echo "Error: BLDR_DIR is not set. Please ensure it points to a valid directory."
exit 1
fi
# Define the path to the docker-compose.yml file
compose_file="$BLDR_DIR/docker-compose.yml"
# Check if the docker-compose.yml file exists
if [[ ! -f "$compose_file" ]]; then
echo "Error: No docker-compose.yml file found in $BLDR_DIR"
exit 1
fi
# Read the contents of the docker-compose.yml file into BLDR_OLD_DCF variable
BLDR_OLD_DCF=$(<"$compose_file")
-32
View File
@@ -1,32 +0,0 @@
#!/bin/bash
get_vols() {
local compose_content="$1"
local volumes=""
# Use yq to extract volumes from services
volumes=$(echo "$compose_content" | yq eval '.services.*.volumes[]' - 2>/dev/null)
# Print the volumes, preserving line breaks
printf "%s\n" "$volumes"
}
get_env_vars() {
local compose_content="$1"
local env_vars=""
# Use yq to extract environment variables in 'key=value' format without indices
env_vars=$(echo "$compose_content" | yq eval '.services.*.environment[]' - 2>/dev/null)
echo "$env_vars"
}
get_image() {
local compose_content="$1"
local images=""
# Use yq to extract image names from services
images=$(echo "$compose_content" | yq eval '.services.*.image' - 2>/dev/null)
echo "$images"
}
-43
View File
@@ -1,43 +0,0 @@
#!/bin/bash
# Function to check if a command is installed and provide installation instructions if not
check_command() {
local command_name="$1"
if ! command -v "$command_name" &> /dev/null; then
echo "$command_name is not installed."
echo "To install $command_name:"
case "$(uname -s)" in
Linux*)
if [ -f /etc/os-release ]; then
. /etc/os-release
case "$ID" in
fedora)
echo " - Fedora: sudo dnf install $command_name"
;;
arch)
echo " - Arch: sudo pacman -S $command_name"
;;
debian | ubuntu)
echo " - Debian/Ubuntu: sudo apt install $command_name"
;;
*)
echo " - On other Linux distros, refer to your package manager's documentation."
;;
esac
else
echo " - Linux: refer to your package manager's documentation for installation."
fi
;;
Darwin*)
echo " - macOS: brew install $command_name (Homebrew)"
;;
*)
echo " - Unsupported OS. Please install $command_name manually."
;;
esac
exit 1
fi
}
-57
View File
@@ -1,57 +0,0 @@
#!/bin/bash
# Variables for README content
DESCRIPTION="${DESCRIPTION:-This is a sample project.}"
AUTHOR="${AUTHOR:-Nick Yeoman}"
UPDATED=$(date +"%a %B %d, %Y %H:%M:%S %Z")
# Function to generate a README file
generate_readme() {
local readme_content=""
# Header
readme_content+="# $BLDR_APP\n\n"
readme_content+="Last Updated: $UPDATED\n\n"
# Overview
readme_content+="## Overview\n"
readme_content+="Docker Hub: \n"
readme_content+="Project: \n"
readme_content+="Docker Compose Example: \n"
readme_content+="Proxy Port: \n"
# Description
readme_content+="## Description\n"
readme_content+="$DESCRIPTION\n\n"
# Usage
readme_content+="## Usage\n"
readme_content+="Provide examples of how to use the project:\n\n"
readme_content+="\`\`\`bash\n"
readme_content+="# Example command\n"
readme_content+="\`\`\`\n\n"
# Environment Variables
readme_content+="## Environment Variables\n"
readme_content+="List of environment variables used in the project:\n\n"
# Extract environment variables from BLDR_NEW_SE
while IFS= read -r line; do
# Use regex to match and extract variable names and defaults
if [[ $line =~ ^([A-Za-z_][A-Za-z0-9_]*)=(.*)$ ]]; then
var_name="${BASH_REMATCH[1]}"
var_value="${BASH_REMATCH[2]}"
readme_content+="* \`$var_name\`: $var_value\n"
fi
done <<< "$BLDR_NEW_SE"
readme_content+="\n"
# Author
readme_content+="## Author\n"
readme_content+="Developed by $AUTHOR.\n"
# Output the README content to a file
echo -e "$readme_content"
}
-23
View File
@@ -1,23 +0,0 @@
#!/bin/bash
BLDR_ENV_FILE+="# $BLDR_APP\n"
BLDR_ENV_FILE+="COOKBOOK=/git/docker-compose-cookbooks #HELP: cookbooks\n"
while IFS= read -r line; do
# Use a regex to match and extract variable names and defaults
if [[ $line =~ \$\{([A-Za-z_][A-Za-z0-9_]*)\} ]]; then
# Matched ${VAR_NAME} (without default)
var_name="${BASH_REMATCH[1]}"
BLDR_ENV_FILE+="${var_name}=\n"
elif [[ $line =~ \$\{([A-Za-z_][A-Za-z0-9_]*)[:-](.*)\} ]]; then
# Matched ${VAR_DEF:-default} (with default)
var_name="${BASH_REMATCH[1]}"
default_value="${BASH_REMATCH[2]:1}"
BLDR_ENV_FILE+="${var_name}=${default_value}\n"
fi
done <<< "$BLDR_NEW_DCF"
# Remove duplicates from the output
BLDR_ENV_FILE=$(echo -e "$BLDR_ENV_FILE" | sort -u)
echo "$BLDR_ENV_FILE" > ${BLDR_DIR}/sample.env
-7
View File
@@ -1,7 +0,0 @@
#!/bin/bash
debug_print_helper_variables() {
for var in $(compgen -v | grep '^HLPR_'); do
echo "$var=${!var}"
done
}
-34
View File
@@ -1,34 +0,0 @@
#!/bin/bash
# Function to create directories based on volumes in docker-compose files
create_dirs() {
local project_path="$1"
local selected_dirs="$2"
local cookbook_dir="$3"
local data_dir="$project_path/data"
# Loop through selected directories
for dir in $selected_dirs; do
local compose_file="$cookbook_dir/$dir/docker-compose.yml"
# Check if the docker-compose file exists
if [ -f "$compose_file" ]; then
# Loop through each line in the file
while IFS= read -r line; do
trimmed_line=$(echo "$line" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
# Check if the line starts with a dash
if [[ $trimmed_line =~ ^- ]]; then
if [[ $trimmed_line =~ VOL_PATH ]]; then
extracted=$(echo "$trimmed_line" | sed -n 's/.*\${VOL_PATH:-[^}]*}\([^:]*\):.*/\1/p' | sed 's/^\/\+//')
# Echo the line if it starts with a dash
mkdir -p $project_path/data/${extracted}
fi
fi
done < "$compose_file"
else
echo "Warning: No docker-compose.yml found in $dir"
fi
done
}
-30
View File
@@ -1,30 +0,0 @@
#!/bin/bash
# Function to create a new docker-compose file using extends
create_dockercompose() {
local project_path="$1"
local selected_dirs="$2"
local script_dir="$3" # Directory where helper.bash is located
# Initialize the new docker-compose file
local new_compose_file="$project_path/docker-compose.yml"
# Write the initial part of the docker-compose file
echo "version: '3.4'" > "$new_compose_file"
echo "" >> "$new_compose_file"
echo "services:" >> "$new_compose_file"
# Loop through selected directories
for dir in $selected_dirs; do
local sample_file="$script_dir/$dir/sample-extends.yml"
if [ -f "$sample_file" ]; then
# Extract services section from the sample file and append it
awk '/^services:/{flag=1; next}/^$/{flag=0}flag' "$sample_file" >> "$new_compose_file"
echo "" >> "$new_compose_file" # Add a newline after each file's content
else
echo "Warning: Create an issue: No sample-extends.yml found in $dir"
cp $script_dir/$dir/docker-compose.yml $new_compose_file
fi
done
}
-104
View File
@@ -1,104 +0,0 @@
#!/bin/bash
process_help_comments() {
local input_file="$1"
local output_file="$2"
local project_path="$3"
local cookbook_dir="$4"
local temp_file=$(mktemp)
while IFS= read -r line; do
# Handle headings (keep headings and process below lines)
if [[ "$line" =~ ^# ]]; then
echo "$line" >> "$temp_file"
elif [[ "$line" =~ ^([^=]+)= ]]; then
local var_name="${BASH_REMATCH[1]}"
local var_value="${line#*=}"
var_value=$(echo "$var_value" | sed 's/\s*#HELP:.*$//')
# Process #HELP comments
if [[ "$line" =~ \#HELP:\ project_path ]]; then
var_value="$HLPR_PROJECTPATH"
elif [[ "$line" =~ \#HELP:\ volpath ]]; then
var_value="$HLPR_PROJECTPATH/data"
elif [[ "$line" =~ \#HELP:\ configpath ]]; then
var_value="$HLPR_PROJECTPATH/config"
elif [[ "$line" =~ \#HELP:\ cookbooks ]]; then
var_value="$HLPR_COOKBOOKDIR"
elif [[ "$line" =~ \#HELP:\ gen32 ]]; then
var_value=$(pwgen -cnsB1v 32)
fi
# Add the processed variable to the temp file
echo "${var_name}=${var_value}" >> "$temp_file"
else
# If the line doesn't match a variable, just echo it
echo "$line" >> "$temp_file"
fi
done < "$input_file"
# Call remove_duplicate_variables to process temp_file and write to output_file
cat "$temp_file" >> $output_file
rm "$temp_file"
}
remove_duplicate_variables() {
local input_file="$1"
local temp_file=$(mktemp)
declare -A seen_keys
while IFS= read -r line; do
# Skip lines that start with # or are blank
if [[ ! $line =~ ^# ]] && [[ -n $line ]]; then
# Extract the part before the equals sign
key=$(echo "$line" | awk -F '=' '{print $1}')
# Check if the key has already been seen
if [[ -z "${seen_keys[$key]}" ]]; then
# Mark the key as seen
seen_keys[$key]=1
# Output the key
echo "$line" >> "$temp_file"
fi
else
echo "$line" >> "$temp_file"
fi
done < "$input_file"
# Replace the original file with the deduplicated version
mv "$temp_file" "$input_file"
}
# Function to create .env file
create_env() {
local project_path="$1"
local selected_dirs="$2"
local cookbook_dir="$3"
local new_env_file="$project_path/.env"
local current_date=$(date)
local git_user=$(git config --get user.name)
if [[ -z "$git_user" ]]; then
local git_user=$USER
fi
# Create the file
touch $new_env_file
echo "# Auto Generated env file on $current_date by $git_user" >> "$new_env_file"
# Loop through selected directories and process sample.env files
for dir in $selected_dirs; do
local sample_file="$cookbook_dir/$dir/sample.env"
if [ -f "$sample_file" ]; then
process_help_comments "$sample_file" "$new_env_file" "$project_path" "$cookbook_dir"
else
echo "Warning: Create an issue: No sample.env found in $dir" >&2
echo "#No Sample File found, raise a bug" >> "$new_env_file"
fi
done
remove_duplicate_variables "$new_env_file"
}
-9
View File
@@ -1,9 +0,0 @@
#!/bin/bash
function display_footer() {
echo "======================================"
echo "All Done"
echo "Created Project: $HLPR_PROJECTNAME in $HLPR_PROJECTDIR"
echo "With the following containers:"
echo $HLPR_CONTAINERS
}
-22
View File
@@ -1,22 +0,0 @@
#!/bin/bash
# Function to create a .gitignore file with standard ignores
create_gitignore() {
local project_path="$1"
local gitignore_path="$project_path/.gitignore"
# Create the .gitignore file
cat <<EOL > "$gitignore_path"
data/
logs/
*.log
.vscode/
.idea/
*.suo
*.ntvs*
*.njsproj
*.sln
.DS_Store
Thumbs.db
EOL
}
-7
View File
@@ -1,7 +0,0 @@
#!/bin/bash
function display_header() {
echo "======================================"
echo " Docker Compose Project Setup Wizard"
echo "======================================"
}
-25
View File
@@ -1,25 +0,0 @@
#!/bin/bash
# Function to check if fzf is installed and provide installation instructions if not
check_fzf() {
if ! command -v fzf &> /dev/null; then
echo "fzf is not installed."
echo "To install fzf:"
echo " - Fedora: sudo dnf install fzf"
echo " - Arch: sudo pacman -S fzf"
echo " - Debian: sudo apt install fzf"
exit 1
fi
}
# Function to check if pwgen is installed and provide installation instructions if not
check_pwgen() {
if ! command -v pwgen &> /dev/null; then
echo "pwgen is not installed."
echo "To install pwgen:"
echo " - Fedora: sudo dnf install pwgen"
echo " - Arch: sudo pacman -S pwgen"
echo " - Debian: sudo apt install pwgen"
exit 1
fi
}
-43
View File
@@ -1,43 +0,0 @@
#!/bin/bash
# Function to check if the project directory already exists
check_project() {
local path="$1"
if [ -d "$path" ]; then
echo "Error: Directory '$path' already exists."
return 1
fi
return 0
}
# Function to create the project directory
create_project() {
local path="$1"
mkdir -p "$path"
if [ $? -ne 0 ]; then
echo "Error: Failed to create directory '$path'. Exiting."
exit 1
fi
}
# Function to handle the project directory creation process
handle_project_creation() {
local project_path="$1"
local project_name="$2"
while true; do
check_project "$HLPR_PROJECTDIR"
if [ $? -eq 0 ]; then
create_project "$HLPR_PROJECTDIR"
break
else
read -p "Please enter a new directory path (must not exist): " new_project_path
if [ -z "$new_project_path" ]; then
echo "Error: Path cannot be empty. Exiting."
exit 1
fi
project_path="$new_project_path"
HLPR_PROJECTDIR="$project_path/$project_name"
fi
done
}
-13
View File
@@ -1,13 +0,0 @@
#!/bin/bash
# Function to get user input for project name
get_project_name() {
while true; do
read -p "Enter project name (usually the domain name, like www-example-com): " HLPR_PROJECTNAME
if [[ "$HLPR_PROJECTNAME" =~ ^[a-zA-Z0-9-]+$ ]]; then
break
else
echo "Invalid project name. Please use only letters, numbers, and dashes. No spaces allowed."
fi
done
}
-19
View File
@@ -1,19 +0,0 @@
#!/bin/bash
# Function to display directories using fzf with enhanced parameters
select_directory_with_fzf() {
# Find all directories under the user's home directory, excluding dot directories and suppressing permission errors
local fzf_input=$(find "$HOME" -type d -not -path '*/\.*' 2>/dev/null | while read -r dir; do [ -r "$dir" ] && echo "$dir"; done)
# Use fzf with enhanced parameters for better usability
selected_path=$(echo "$fzf_input" | fzf --height 40% --layout=reverse --border --preview 'echo {} | xargs -I % du -sh % 2>/dev/null' --preview-window=up:30% --prompt="Select a directory: ")
# Handle the case where no directory was selected
if [ -z "$selected_path" ]; then
echo "No directory selected. Exiting."
exit 1
fi
# Output the selected path
HLPR_PROJECTPATH="$selected_path"
}
-50
View File
@@ -1,50 +0,0 @@
#!/bin/bash
# Function to create a README.md file
create_readme() {
local project_path="$1"
local project_name="$2"
local selected_dirs="$3"
local readme_path="$project_path/README.md"
local current_date=$(date +"%Y-%m-%d")
# Retrieve the full name from the global Git config
local git_name=$(git config --global user.name)
if [ -z "$git_name" ]; then
echo 'WARNING: Set your git username: git config --global user.name "Your Name"'
git_name="$USER"
fi
# Create the README.md file
cat <<EOL > "$readme_path"
# $project_name
Project created on $current_date by $git_name
## Description
A brief description of your project goes here.
## Project Structure
This project includes the following containers:
EOL
# Add the selected directories to the README
if [ -n "$selected_dirs" ]; then
echo "$selected_dirs" | while read -r dir; do
echo "- $(basename "$dir")" >> "$readme_path"
done
else
echo "No containers selected." >> "$readme_path"
fi
cat <<EOL >> "$readme_path"
## Usage
podman-compose up -d
EOL
}
-21
View File
@@ -1,21 +0,0 @@
#!/bin/bash
# Function to list all directories in the same directory as the helper script and allow the user to select multiple directories
select_directories() {
# Get the directory where this script is located
local script_dir=$(dirname "$(realpath "$0")")
# Find all directories in the same directory as the helper script and get their basenames, excluding those starting with an underscore
local dir_list=$(find "$script_dir" -maxdepth 1 -type d -not -path '*/\.*' -not -path "$script_dir" -not -name '_*' | xargs -I {} basename {})
# Use fzf to allow the user to select multiple directories with checkboxes
local selected_dirs=$(echo "$dir_list" | fzf --multi --height 40% --layout=reverse --border --prompt="Select directories (TAB to toggle, ENTER to confirm): " --bind 'tab:toggle+down')
# Handle the case where no directory was selected
if [ -z "$selected_dirs" ]; then
echo "No directories selected. Exiting."
exit 1
fi
HLPR_CONTAINERS="$selected_dirs"
}
-90
View File
@@ -1,90 +0,0 @@
#!/bin/bash
BLDR_APP=""
BLDR_DC_ENV=""
BLDR_DC_IMAGE=""
BLDR_DC_VOLS=""
BLDR_DIR=""
BLDR_ENV_FILE=""
BLDR_NEW_DCF="" # Content of New Docker Compose File
BLDR_NEW_README=""
BLDR_NEW_SE="" # sample-extends
BLDR_OLD_DCF="" # Content of Old Docker Compose File
BLDR_PARENT_PATH=$(dirname "$(realpath "${BASH_SOURCE[0]}")")
source ./_builder/debug.sh
#debug_print_helper_variables
################################################
# Pre Check
################################################
source ./_builder/precheck.sh
check_command "fzf"
check_command "yq"
################################################
# Get Directory we are working with
################################################
source ./_builder/getdir.bash
################################################
# Save file to work with
################################################
source ./_builder/olddcf.bash
################################################
# Take out the stuff we need
################################################
source ./_builder/parse.bash
BLDR_DC_VOLS=$(get_vols "$BLDR_OLD_DCF")
BLDR_DC_ENV=$(get_env_vars "$BLDR_OLD_DCF")
BLDR_DC_IMAGE=$(get_image "$BLDR_OLD_DCF")
unset BLDR_OLD_DCF # Done, got the stuff we need
################################################
# Clean up the IMAGE
################################################
source ./_builder/dc-image.sh
BLDR_DC_IMAGE=$(extract_image_name "$BLDR_DC_IMAGE")
################################################
# Clean up VOLS
################################################
source ./_builder/dc-vols.sh
BLDR_DC_VOLS=$(process_volumes "$BLDR_DC_VOLS")
################################################
# Clean up ENV
################################################
source ./_builder/dc-env.sh
# echo "The Input: "
# echo "$BLDR_DC_ENV"
BLDR_DC_ENV=$(process_env_vars "$BLDR_DC_ENV" "$BLDR_APP")
# echo "The Output: "
# echo "$BLDR_DC_ENV"
# exit
################################################
# Compile New Docker Var BLDR_NEW_DCF
################################################
source ./_builder/dc-new.sh
################################################
# Create sample-env
################################################
source ./_builder/se-new.sh
################################################
# Create sample-extends
################################################
source ./_builder/extends-new.sh
################################################
# Create Readme.md
################################################
if [[ ! -f "${BLDR_DIR}/README.md" ]]; then
source ./_builder/readme-new.sh
BLDR_NEW_README=$(generate_readme)
echo "$BLDR_NEW_README" > ${BLDR_DIR}/README.md
fi
-84
View File
@@ -1,84 +0,0 @@
#!/bin/bash
HLPR_COOKBOOKDIR="$(dirname "$(realpath "$BASH_SOURCE")")"
HLPR_PROJECTNAME='NEW_PROJECT'
HLPR_PROJECTPATH=$HOME
HLPR_PROJECTDIR="$HLPR_PROJECTPATH/$HLPR_PROJECTNAME"
HLPR_CONTAINERS=''
#source ./_helper/debug.sh
# debug_print_helper_variables
################################################
# Pre Check
################################################
source ./_helper/precheck.sh
check_fzf
check_pwgen
################################################
# Display Header
################################################
source ./_helper/header.sh
display_header
################################################
# Get Project Name
################################################
source ./_helper/project-name.sh
get_project_name
################################################
# Get Project Path
################################################
source ./_helper/project-path.sh
select_directory_with_fzf
HLPR_PROJECTDIR="$HLPR_PROJECTPATH/$HLPR_PROJECTNAME"
################################################
# Select containers
################################################
source ./_helper/select-containers.sh
select_directories
################################################
# Create Project Directory
################################################
source ./_helper/project-create.sh
handle_project_creation "$HLPR_PROJECTPATH" "$HLPR_PROJECTNAME"
################################################
# Create a .gitignore
################################################
source ./_helper/gitignore.sh
create_gitignore "$HLPR_PROJECTDIR"
################################################
# Create a README.md
################################################
source ./_helper/readme.sh
create_readme "$HLPR_PROJECTDIR" "$HLPR_PROJECTNAME" "$HLPR_CONTAINERS"
################################################
# Create docker-compose
################################################
source ./_helper/dockercompose.sh
create_dockercompose "$HLPR_PROJECTDIR" "$HLPR_CONTAINERS" "$HLPR_COOKBOOKDIR"
################################################
# Create env
################################################
source ./_helper/env.sh
create_env "$HLPR_PROJECTDIR" "$HLPR_CONTAINERS" "$HLPR_COOKBOOKDIR"
################################################
# Create directories
################################################
source ./_helper/dirs.sh
create_dirs "$HLPR_PROJECTDIR" "$HLPR_CONTAINERS" "$HLPR_COOKBOOKDIR"
################################################
# Display Footer
################################################
source ./_helper/footer.sh
display_footer