Skip to content

Commit 596b074

Browse files
committed
Use Qlot for CI.
1 parent 5090bd6 commit 596b074

8 files changed

+65
-16
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.qlot

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@
99

1010
t/test.db
1111
.qlot/
12-
qlfile
13-
qlfile.lock

docker-compose.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ services:
1010
- LISP=${LISP:-sbcl}
1111
restart: "no"
1212
volumes:
13-
- ./:/app/
13+
- .:/app
14+
- /app/.qlot
1415
depends_on:
1516
- postgres
1617
- mysql
@@ -26,7 +27,8 @@ services:
2627
container_name: mito-postgres
2728
image: "postgres:10"
2829
hostname: mito-test-postgres
29-
restart: always
30+
ports:
31+
- "5432:5432"
3032
environment:
3133
POSTGRES_USER: mito
3234
POSTGRES_PASSWORD: mito
@@ -35,7 +37,8 @@ services:
3537
container_name: mito-mysql
3638
image: "mysql:8.4"
3739
hostname: mito-test-mysql
38-
restart: always
40+
ports:
41+
- "3306:3306"
3942
command: --mysql_native_password=ON
4043
environment:
4144
MYSQL_ROOT_PASSWORD: mito

docker/Dockerfile

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
11
ARG LISP=sbcl
2+
3+
FROM fukamachi/qlot AS build-env
4+
5+
WORKDIR /app
6+
COPY qlfile /app
7+
COPY qlfile.lock /app
8+
9+
RUN qlot install --no-deps
10+
211
FROM fukamachi/${LISP} AS base
312

4-
RUN ros -e '(ql-dist:install-dist "http://dist.ultralisp.org/" :prompt nil)'
5-
RUN ros install fukamachi/cl-dbi rove
613
RUN apt-get update && \
714
apt-get install -y --no-install-recommends \
815
libsqlite3-dev \
916
default-libmysqlclient-dev \
1017
default-mysql-client && \
1118
rm -rf /var/lib/apt/lists/*
1219

13-
COPY . /app
1420
WORKDIR /app
21+
RUN set -x; \
22+
ros -e '(ql:update-dist "quicklisp" :prompt nil)' && \
23+
ros install "fukamachi/qlot"
1524

16-
ENV CL_SOURCE_REGISTRY "/app/"
25+
COPY --from=build-env /app/.qlot /app/.qlot
26+
27+
COPY . /app
28+
RUN qlot install
1729

1830
ENTRYPOINT "/app/docker/entrypoint.sh"

docker/entrypoint.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
set -x
44
set -e
55

6+
qlot exec ros -s mito-test
7+
68
while ! mysql -u "$MYSQL_USER" \
79
-h "$MYSQL_HOST" \
810
-P "$MYSQL_PORT" \
@@ -11,5 +13,4 @@ while ! mysql -u "$MYSQL_USER" \
1113
sleep 1
1214
done
1315

14-
ros -s mito-test
15-
rove mito-test.asd
16+
.qlot/bin/rove mito-test.asd

qlfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ql cl-dbi :upstream
2+
ql cl-mysql :upstream
3+
ql dissect :upstream
4+
ql sxql :upstream
5+
ql rove :upstream

qlfile.lock

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
("quicklisp" .
2+
(:class qlot/source/dist:source-dist
3+
:initargs (:distribution "https://beta.quicklisp.org/dist/quicklisp.txt" :%version :latest)
4+
:version "2023-10-21"))
5+
("cl-dbi" .
6+
(:class qlot/source/ql:source-ql-upstream
7+
:initargs nil
8+
:version "ql-upstream-2ff41f0706180e140a31b844da4f0272e1a281cd"
9+
:remote-url "https://github.com/fukamachi/cl-dbi.git"))
10+
("cl-mysql" .
11+
(:class qlot/source/ql:source-ql-upstream
12+
:initargs nil
13+
:version "ql-upstream-b273cf772f13a525b534f5ee58bf36fb733204f3"
14+
:remote-url "https://github.com/hackinghat/cl-mysql.git"))
15+
("dissect" .
16+
(:class qlot/source/ql:source-ql-upstream
17+
:initargs nil
18+
:version "ql-upstream-a70cabcd748cf7c041196efd711e2dcca2bbbb2c"
19+
:remote-url "https://github.com/Shinmera/dissect.git"))
20+
("sxql" .
21+
(:class qlot/source/ql:source-ql-upstream
22+
:initargs nil
23+
:version "ql-upstream-c79c252bef276bb0343ced5149083e3b91d85d9b"
24+
:remote-url "https://github.com/fukamachi/sxql.git"))
25+
("rove" .
26+
(:class qlot/source/ql:source-ql-upstream
27+
:initargs nil
28+
:version "ql-upstream-cacea7331c10fe9d8398d104b2dfd579bf7ea353"
29+
:remote-url "https://github.com/fukamachi/rove.git"))

t/util.lisp

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
:port (parse-integer
3535
(or (uiop:getenv "POSTGRES_PORT")
3636
"5432"))
37-
:username (or (uiop:getenv "POSTGRES_USER") "nobody")
38-
:password (or (uiop:getenv "POSTGRES_PASS") "nobody")
37+
:username (or (uiop:getenv "POSTGRES_USER") "mito")
38+
:password (or (uiop:getenv "POSTGRES_PASS") "mito")
3939
:microsecond-precision t))
4040

4141
(defun mysql-disconnect-from-testdb (conn)
@@ -44,12 +44,12 @@
4444
(defun mysql-connect-to-testdb ()
4545
(dbi:connect :mysql
4646
:database-name "mito"
47-
:host (or (uiop:getenv "MYSQL_HOST") "localhost")
47+
:host (or (uiop:getenv "MYSQL_HOST") "0.0.0.0")
4848
:port (parse-integer
4949
(or (uiop:getenv "MYSQL_PORT")
5050
"3306"))
51-
:username (or (uiop:getenv "MYSQL_USER") "nobody")
52-
:password (or (uiop:getenv "MYSQL_PASS") "nobody")))
51+
:username (or (uiop:getenv "MYSQL_USER") "root")
52+
:password (or (uiop:getenv "MYSQL_PASS") "mito")))
5353

5454
(defun disconnect-from-testdb (conn)
5555
(funcall

0 commit comments

Comments
 (0)