From 62b054ce7443c4d3728c603ce581d4b167119394 Mon Sep 17 00:00:00 2001 From: Trevor Fitzgerald Date: Tue, 26 Sep 2023 20:51:35 -0400 Subject: [PATCH] docs: how to use local copy of Scalachess closes #9 --- README.md | 35 ++++++++++++++++++++++++++++------- docker-compose.yml | 1 + 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index fae77c6a..c372efb4 100644 --- a/README.md +++ b/README.md @@ -25,24 +25,20 @@ The only requirements for running on your local machine are `git` and Docker Des Lila will be the last service to complete, at which point you can visit http://localhost:8080/ to see the site. -### Shutting down / Resetting +### Stopping -When you're done working, you can shut down the services with: +To stop the containers, for later resuming via `./lila-docker start`: ```bash ./lila-docker stop ``` -When the `stop` command is used, `./lila-docker start` can be later used to resume the stopped services. - -Alternatively, you can shut down and remove the services with: +To remove the containers: ```bash ./lila-docker down ``` -When the `down` command is used, `./lila-docker start` can be later used to create and start new services. - ## URLs Always available: @@ -125,6 +121,31 @@ Once the build has been imported, you should have code completion, go to definit ### Scalachess: +If you're making changes to the Scalachess library, you can have lila use it instead of the published Maven version: + +1. Update the `build.sbt` file in the scalachess repo: + + ```diff + - ThisBuild / version := "15.6.7" + + ThisBuild / version := "my-test-1" # give it a custom version + ``` + +2. Update the `Dependencies.scala` file in the lila repo: + + ```diff + - val chess = "org.lichess" %% "scalachess" % "15.6.7" + + val chess = "org.lichess" %% "scalachess" % "my-test-1" + ``` + +3. Publish the local scalachess changes and restart lila: + + ```bash + docker compose exec lila bash -c "cd /scalachess && sbt publishLocal" + docker compose restart lila + ``` + +Other Scalachess commands: + ```bash ## compile docker run --rm -v $(pwd)/repos/scalachess:/mnt \ diff --git a/docker-compose.yml b/docker-compose.yml index 3577ddcc..3d8ed147 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,6 +23,7 @@ services: - ./repos/chessground:/chessground - ./repos/pgn-viewer:/pgn-viewer - ./repos/bbpPairings.exe:/opt/bbpPairings.exe + - ./repos/scalachess:/scalachess - ./conf/lila.conf:/lila/conf/application.conf lila_ws: