@@ -10,46 +10,14 @@ IMPORT ../java AS java
10
10
postgres-base :
11
11
FROM postgres:16.4-bookworm
12
12
13
- ARG SCHEMASPY_VERSION= 6.2.4
14
- ARG POSTGRESQL_JDBC_VERSION= 42.7.4
15
-
16
13
WORKDIR /root
17
14
18
15
# Install necessary packages
19
16
# Expand this list as needed, rather than adding more tools in later containers.
20
17
RUN apt-get update && apt-get install -y \
21
- bash \
22
- build-essential \
23
- clang \
24
- cmake \
25
- colordiff \
26
- findutils \
27
- fontconfig \
28
- fonts-liberation2 \
29
- graphviz \
30
- libssl-dev \
31
- mold \
32
- openssl \
33
- pkgconf \
34
- python3-pip \
35
18
python3-rich \
36
- python3-psycopg \
37
- ripgrep \
38
- wget \
39
- pipx \
40
19
&& rm -rf /var/lib/apt/lists/*
41
20
42
- # Use the cached java installation from the java Earthfile
43
- DO java+COPY_DEPS
44
-
45
- # Install SQLFluff - Check
46
- ENV PATH= "/root/.local/bin:${PATH}"
47
- RUN pipx install sqlfluff== 3.1.1 && sqlfluff version
48
-
49
- # Install SchemaSpy and required Postgresql JDBC driver
50
- RUN wget -O /bin/postgresql.jar https://jdbc.postgresql.org/download/postgresql-${POSTGRESQL_JDBC_VERSION }.jar
51
- RUN wget -O /bin/schemaspy.jar https://github.com/schemaspy/schemaspy/releases/download/v${SCHEMASPY_VERSION }/schemaspy-${SCHEMASPY_VERSION }.jar
52
-
53
21
# Get refinery
54
22
COPY rust-tools+tool-refinery/refinery /bin
55
23
@@ -68,6 +36,17 @@ postgres-base:
68
36
SAVE ARTIFACT /scripts /scripts
69
37
SAVE ARTIFACT /templates /templates
70
38
39
+ sqlfluff-base :
40
+ FROM +postgres-base
41
+
42
+ RUN apt-get update && apt-get install -y \
43
+ colordiff \
44
+ pipx
45
+
46
+ # Install SQLFluff - Check
47
+ ENV PATH= "/root/.local/bin:${PATH}"
48
+ RUN pipx install sqlfluff== 3.1.1 && sqlfluff version
49
+
71
50
# Common build setup steps.
72
51
# Arguments:
73
52
# sqlfluff_cfg - REQUIRED - Location of repos .sqlfluff configuration file.
@@ -115,9 +94,22 @@ DOCS:
115
94
116
95
ARG migrations= ./migrations
117
96
ARG refinery_toml= ./refinery.toml
97
+ ARG SCHEMASPY_VERSION= 6.2.4
98
+ ARG POSTGRESQL_JDBC_VERSION= 42.7.4
118
99
119
100
FROM +postgres-base
120
101
102
+ RUN apt-get update && apt-get install -y \
103
+ graphviz \
104
+ wget
105
+
106
+ # Use the cached java installation from the java Earthfile
107
+ DO java+COPY_DEPS
108
+
109
+ # Install SchemaSpy and required Postgresql JDBC driver
110
+ RUN wget -O /bin/postgresql.jar https://jdbc.postgresql.org/download/postgresql-${POSTGRESQL_JDBC_VERSION }.jar
111
+ RUN wget -O /bin/schemaspy.jar https://github.com/schemaspy/schemaspy/releases/download/v${SCHEMASPY_VERSION }/schemaspy-${SCHEMASPY_VERSION }.jar
112
+
121
113
USER postgres:postgres
122
114
WORKDIR /docs
123
115
@@ -133,7 +125,7 @@ DOCS:
133
125
# Linter checks for sql files
134
126
CHECK :
135
127
FUNCTION
136
-
128
+
137
129
RUN /scripts/std_checks.py
138
130
139
131
# Format sql files
0 commit comments