Skip to content

Commit

Permalink
Use Qlot for CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
fukamachi committed Jul 9, 2024
1 parent 5090bd6 commit 596b074
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 16 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.qlot
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@

t/test.db
.qlot/
qlfile
qlfile.lock
9 changes: 6 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ services:
- LISP=${LISP:-sbcl}
restart: "no"
volumes:
- ./:/app/
- .:/app
- /app/.qlot
depends_on:
- postgres
- mysql
Expand All @@ -26,7 +27,8 @@ services:
container_name: mito-postgres
image: "postgres:10"
hostname: mito-test-postgres
restart: always
ports:
- "5432:5432"
environment:
POSTGRES_USER: mito
POSTGRES_PASSWORD: mito
Expand All @@ -35,7 +37,8 @@ services:
container_name: mito-mysql
image: "mysql:8.4"
hostname: mito-test-mysql
restart: always
ports:
- "3306:3306"
command: --mysql_native_password=ON
environment:
MYSQL_ROOT_PASSWORD: mito
20 changes: 16 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
ARG LISP=sbcl

FROM fukamachi/qlot AS build-env

WORKDIR /app
COPY qlfile /app
COPY qlfile.lock /app

RUN qlot install --no-deps

FROM fukamachi/${LISP} AS base

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

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

ENV CL_SOURCE_REGISTRY "/app/"
COPY --from=build-env /app/.qlot /app/.qlot

COPY . /app
RUN qlot install

ENTRYPOINT "/app/docker/entrypoint.sh"
5 changes: 3 additions & 2 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
set -x
set -e

qlot exec ros -s mito-test

while ! mysql -u "$MYSQL_USER" \
-h "$MYSQL_HOST" \
-P "$MYSQL_PORT" \
Expand All @@ -11,5 +13,4 @@ while ! mysql -u "$MYSQL_USER" \
sleep 1
done

ros -s mito-test
rove mito-test.asd
.qlot/bin/rove mito-test.asd
5 changes: 5 additions & 0 deletions qlfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ql cl-dbi :upstream
ql cl-mysql :upstream
ql dissect :upstream
ql sxql :upstream
ql rove :upstream
29 changes: 29 additions & 0 deletions qlfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
("quicklisp" .
(:class qlot/source/dist:source-dist
:initargs (:distribution "https://beta.quicklisp.org/dist/quicklisp.txt" :%version :latest)
:version "2023-10-21"))
("cl-dbi" .
(:class qlot/source/ql:source-ql-upstream
:initargs nil
:version "ql-upstream-2ff41f0706180e140a31b844da4f0272e1a281cd"
:remote-url "https://github.com/fukamachi/cl-dbi.git"))
("cl-mysql" .
(:class qlot/source/ql:source-ql-upstream
:initargs nil
:version "ql-upstream-b273cf772f13a525b534f5ee58bf36fb733204f3"
:remote-url "https://github.com/hackinghat/cl-mysql.git"))
("dissect" .
(:class qlot/source/ql:source-ql-upstream
:initargs nil
:version "ql-upstream-a70cabcd748cf7c041196efd711e2dcca2bbbb2c"
:remote-url "https://github.com/Shinmera/dissect.git"))
("sxql" .
(:class qlot/source/ql:source-ql-upstream
:initargs nil
:version "ql-upstream-c79c252bef276bb0343ced5149083e3b91d85d9b"
:remote-url "https://github.com/fukamachi/sxql.git"))
("rove" .
(:class qlot/source/ql:source-ql-upstream
:initargs nil
:version "ql-upstream-cacea7331c10fe9d8398d104b2dfd579bf7ea353"
:remote-url "https://github.com/fukamachi/rove.git"))
10 changes: 5 additions & 5 deletions t/util.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
:port (parse-integer
(or (uiop:getenv "POSTGRES_PORT")
"5432"))
:username (or (uiop:getenv "POSTGRES_USER") "nobody")
:password (or (uiop:getenv "POSTGRES_PASS") "nobody")
:username (or (uiop:getenv "POSTGRES_USER") "mito")
:password (or (uiop:getenv "POSTGRES_PASS") "mito")
:microsecond-precision t))

(defun mysql-disconnect-from-testdb (conn)
Expand All @@ -44,12 +44,12 @@
(defun mysql-connect-to-testdb ()
(dbi:connect :mysql
:database-name "mito"
:host (or (uiop:getenv "MYSQL_HOST") "localhost")
:host (or (uiop:getenv "MYSQL_HOST") "0.0.0.0")
:port (parse-integer
(or (uiop:getenv "MYSQL_PORT")
"3306"))
:username (or (uiop:getenv "MYSQL_USER") "nobody")
:password (or (uiop:getenv "MYSQL_PASS") "nobody")))
:username (or (uiop:getenv "MYSQL_USER") "root")
:password (or (uiop:getenv "MYSQL_PASS") "mito")))

(defun disconnect-from-testdb (conn)
(funcall
Expand Down

0 comments on commit 596b074

Please sign in to comment.