Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions flatten-sql.sh
Original file line number Diff line number Diff line change
@@ -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:?}/"
2 changes: 1 addition & 1 deletion github_conf/branch_protection_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest",
"status": "404"
}
}
12 changes: 3 additions & 9 deletions super-linter-output/super-linter-summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -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