Skip to content

Commit 6991ba7

Browse files
ci: Simplify dockerfiles, add go vet steps, fix ldflag vals for alpine
- Simplify Dockerfiles a bit. Compiling a test binary can be sort of useful to fail quickly. But it's better to just run all the tests because that happens anyways. Also remove LABEL from all Dockerfiles, they aren't used anywhere. - Add go vet Makefile targets. This tool is built in and provides valuable info. - Make an ldflags value work better on alpine. This was more of an annoyance when looking at logs, than anything else. I have manually tested this on MacOS and Ubuntu. It works there too.
1 parent d4c63a9 commit 6991ba7

16 files changed

+52
-33
lines changed

.ci/cassandra/client.Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
FROM godfish_test/client_base:latest
2-
LABEL driver=cassandra role=client
32

43
WORKDIR /src
5-
RUN go build -v ./drivers/cassandra/godfish && \
6-
go test -c . && go test -c ./drivers/cassandra
4+
RUN make build-cassandra
75

86
# Alpine linux doesn't have a cassandra client. Build a golang binary to check
97
# if server is ready and setup the test DB. Use it in the entrypoint.

.ci/cassandra/client.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ done
2626

2727
echo "testing godfish against live db"
2828
make test-cassandra ARGS='-v -count=1'
29+
30+
echo "vetting code"
31+
make vet-cassandra

.ci/cassandra/server_v3.Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM cassandra:3.11.12
2-
LABEL driver=cassandra role=server
32

43
# Tests run on a single node, only need to expose the CQL listener port.
54
EXPOSE 9042

.ci/cassandra/server_v4.Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM cassandra:4.0.3
2-
LABEL driver=cassandra role=server
32

43
# Tests run on a single node, only need to expose the CQL listener port.
54
EXPOSE 9042

.ci/mysql/client.Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
FROM godfish_test/client_base:latest
2-
LABEL driver=mysql role=client
2+
33
WORKDIR /src
4-
RUN apk update && apk --no-cache add mysql-client
5-
RUN go build -v ./drivers/mysql/godfish && \
6-
go test -c . && go test -c ./drivers/mysql
4+
RUN apk update && \
5+
apk --no-cache add mysql-client && \
6+
make build-mysql
7+
78
COPY .ci/mysql/client.sh /
89
ENTRYPOINT /client.sh

.ci/mysql/client.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ done
2828

2929
echo "testing godfish against live db"
3030
make test-mysql ARGS='-v -count=1'
31+
32+
echo "vetting code"
33+
make vet-mysql
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
FROM mariadb:10.6
2-
LABEL driver=mysql role=server
32
EXPOSE 3306
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
FROM mysql:5.7
2-
LABEL driver=mysql role=server
32
EXPOSE 3306
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
FROM mysql:8.0
2-
LABEL driver=mysql role=server
32
EXPOSE 3306

.ci/postgres/client.Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
FROM godfish_test/client_base:latest
2-
LABEL driver=postgres role=client
2+
33
WORKDIR /src
4-
RUN apk --no-cache add postgresql-client
5-
RUN go build -v ./drivers/postgres/godfish && \
6-
go test -c . && go test -c ./drivers/postgres
4+
RUN apk update && \
5+
apk --no-cache add postgresql-client && \
6+
make build-postgres
7+
78
COPY .ci/postgres/client.sh /
89
ENTRYPOINT /client.sh

0 commit comments

Comments
 (0)