diff --git a/Dockerfile b/Dockerfile index 62b8513..29036d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,12 +10,8 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Copy all files into a temporary location COPY . ${TEMP_SQL_DIR}/ -# Flatten the directory structure and rename files to include folder names -RUN find "${TEMP_SQL_DIR:?}/" -type f -name "*.sql" | while read -r file; do \ - new_name=$(echo "$file" | sed "s|${TEMP_SQL_DIR:?}/||" | sed 's|/|_|g' | sed 's|^_||'); \ - cp "$file" "/docker-entrypoint-initdb.d/$new_name"; \ - done && \ - rm -rf "${TEMP_SQL_DIR:?}/" +# Run the flatten script +RUN chmod +x ${TEMP_SQL_DIR}/flatten-sql.sh && ${TEMP_SQL_DIR}/flatten-sql.sh # Expose the default MariaDB port (3306) EXPOSE 3306 diff --git a/flatten-sql.sh b/flatten-sql.sh new file mode 100755 index 0000000..8852abc --- /dev/null +++ b/flatten-sql.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -euo pipefail + +TEMP_SQL_DIR=${TEMP_SQL_DIR:-/temp-sql-files} +INITDB_DIR=${INITDB_DIR:-/docker-entrypoint-initdb.d} + +echo "Flattening SQL files from $TEMP_SQL_DIR to $INITDB_DIR" + +find "${TEMP_SQL_DIR:?}/" -type f -name "*.sql" | while read -r file; do + new_name=$(echo "$file" | sed "s|${TEMP_SQL_DIR:?}/||" | sed 's|/|_|g' | sed 's|^_||') + cp "$file" "${INITDB_DIR}/${new_name}" +done + +rm -rf "${TEMP_SQL_DIR:?}/" diff --git a/github_conf/branch_protection_rules.json b/github_conf/branch_protection_rules.json index 7dfcef9..e545d76 100644 --- a/github_conf/branch_protection_rules.json +++ b/github_conf/branch_protection_rules.json @@ -2,4 +2,4 @@ "message": "Not Found", "documentation_url": "https://docs.github.com/rest", "status": "404" -} +} \ No newline at end of file diff --git a/super-linter-output/super-linter-summary.md b/super-linter-output/super-linter-summary.md index 899bf68..bf2b125 100644 --- a/super-linter-output/super-linter-summary.md +++ b/super-linter-output/super-linter-summary.md @@ -2,18 +2,12 @@ | Language | Validation result | | -------------------------- | ----------------- | +| BASH | Pass ✅ | +| BASH_EXEC | Pass ✅ | | CHECKOV | Pass ✅ | -| GITHUB_ACTIONS | Pass ✅ | | GITLEAKS | Pass ✅ | | GIT_MERGE_CONFLICT_MARKERS | Pass ✅ | | JSCPD | Pass ✅ | -| JSON | Pass ✅ | -| JSON_PRETTIER | Pass ✅ | -| MARKDOWN | Pass ✅ | -| MARKDOWN_PRETTIER | Pass ✅ | -| NATURAL_LANGUAGE | Pass ✅ | -| SQLFLUFF | Pass ✅ | -| YAML | Pass ✅ | -| YAML_PRETTIER | Pass ✅ | +| SHELL_SHFMT | Pass ✅ | All files and directories linted successfully