Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI image ui/build #74

Merged
merged 3 commits into from
Mar 31, 2024
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
6 changes: 6 additions & 0 deletions .github/workflows/ci-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout lila
uses: actions/checkout@v4
with:
repository: 'lichess-org/lila'
path: 'repos/lila'

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
Expand Down
1 change: 1 addition & 0 deletions conf/ci.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ include "version"

user.password.bpass.secret = "9qEYN0ThHer1KWLNekA76Q=="

net.site.name = "lila"
net.ratelimit = false
17 changes: 11 additions & 6 deletions docker/ci.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
##################################################################################
FROM node:lts-bookworm as node

RUN npm install --global pnpm
COPY repos/lila /lila
COPY conf/ci.conf /lila/conf/application.conf
RUN /lila/ui/build --clean --debug --split

##################################################################################
FROM mongo:7-jammy as dbbuilder

Expand All @@ -20,14 +28,10 @@ RUN mongod --fork --logpath /var/log/mongodb/mongod.log --dbpath /seeded \
--tokens

##################################################################################
FROM sbtscala/scala-sbt:eclipse-temurin-jammy-21.0.2_13_1.9.9_3.4.0 as lilabuilder

RUN apt update && apt install -y git
FROM sbtscala/scala-sbt:eclipse-temurin-alpine-21.0.2_13_1.9.9_3.4.1 as lilabuilder

RUN mkdir /lila
COPY --from=node /lila /lila
WORKDIR /lila
RUN git clone --depth 1 https://github.com/lichess-org/lila.git .
COPY conf/ci.conf ./conf/application.conf
RUN ./lila stage

##################################################################################
Expand All @@ -41,6 +45,7 @@ COPY --from=dbbuilder /jdk-21 /jdk-21
COPY --from=lilabuilder /lila/target /lila/target
COPY --from=lilabuilder /lila/public /lila/public
COPY --from=lilabuilder /lila/conf /lila/conf
COPY --from=node /lila/public /lila/target/universal/stage/public

ENV JAVA_HOME=/jdk-21
ENV PATH=/jdk-21/bin:$PATH
Expand Down
10 changes: 9 additions & 1 deletion docs/ci-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@

```bash
docker build -t lila-ci -f docker/ci.Dockerfile .
docker run -it --rm -p 9663:9663 lila-ci
docker run -it --rm -p 9663:9663 --name lichess lila-ci
```

Visit: <http://localhost:9663/>

```bash
curl localhost:9663/api/user/lichess
```

### Get a shell in the container for debugging:

```bash
docker exec -it lichess bash
```