mirror of
https://github.com/TheRealOwenRees/chess-scribe-api.git
synced 2026-07-23 01:06:56 +00:00
Hotfix/opam install pgn to tex (#2)
* update to latest ocaml/opam release * remove commented out code * update pgn_to_tex version, pinning github tag * update docker container pull from registry script
This commit is contained in:
@@ -21,11 +21,6 @@ jobs:
|
||||
- name: Login to Github Container Registry
|
||||
run: echo "${{ secrets.GHCR_SECRET }}" | docker login ghcr.io -u ${{ env.GH_USER }} --password-stdin
|
||||
|
||||
# - name: Build image and publish
|
||||
# run: |
|
||||
# docker build . -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
# docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
@@ -53,5 +48,6 @@ jobs:
|
||||
port: ${{ secrets.PORT }}
|
||||
script: |
|
||||
cd /home/${{ secrets.USERNAME }}
|
||||
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S docker compose up -d --force-recreate
|
||||
echo "${{ secrets.GHCR_SECRET }}" | docker login ghcr.io -u ${{ env.GH_USER }} --password-stdin
|
||||
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
docker compose up -d
|
||||
|
||||
+4
-3
@@ -1,3 +1,4 @@
|
||||
_build/
|
||||
_opam/
|
||||
.env
|
||||
_build
|
||||
_opam
|
||||
.env
|
||||
.idea
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
# --- STAGE 1: Build the native OCaml binary ---
|
||||
# ocaml/opam:debian-13-ocaml-5.4
|
||||
FROM ocaml/opam@sha256:a43344fd8178438c12ce3c78124f966ac44fb015c7cc4ba685f980f9a0460091 AS builder
|
||||
FROM ocaml/opam@sha256:82a44b5c39729dbea10a5aa394c544e8d2f6cadd2a8d3f7656c2259c72e3e55a AS builder
|
||||
USER opam
|
||||
WORKDIR /app
|
||||
COPY --chown=opam:opam dune-project ./
|
||||
RUN opam update && opam install -y dune dream
|
||||
RUN opam pin add -y pgn_to_tex git+https://github.com/TheRealOwenRees/pgn_to_tex.git#v0.0.1-rc.2
|
||||
RUN opam update && \
|
||||
opam pin add -y pgn_to_tex https://github.com/TheRealOwenRees/pgn_to_tex.git#v0.0.1 && \
|
||||
opam install -y dune dream pgn_to_tex
|
||||
COPY --chown=opam:opam . .
|
||||
RUN opam exec -- dune build bin/main.exe
|
||||
|
||||
|
||||
+2
-4
@@ -69,7 +69,7 @@ let handle_convert request =
|
||||
let pid =
|
||||
Unix.create_process "pdflatex" argv Unix.stdin Unix.stdout Unix.stderr
|
||||
in
|
||||
(* let _, process_status = Unix.waitpid [] pid in *)
|
||||
|
||||
let _, _ = Unix.waitpid [] pid in
|
||||
|
||||
if Sys.file_exists pdf_file_path then (
|
||||
@@ -79,7 +79,6 @@ let handle_convert request =
|
||||
|
||||
cleanup ();
|
||||
|
||||
(* TODO: record_metrics "SUCCESS" start_time; *)
|
||||
Dream.respond ~status:`Created
|
||||
~headers:
|
||||
[
|
||||
@@ -102,7 +101,6 @@ let handle_convert request =
|
||||
| exn ->
|
||||
cleanup ();
|
||||
let err_msg = Printexc.to_string exn in
|
||||
(* TODO: record_metrics "FAIL" start_time err_msg; *)
|
||||
(* TODO: logger.error err_msg; *)
|
||||
|
||||
Dream.json ~status:`Internal_Server_Error
|
||||
(Printf.sprintf {|{"type": "error", "message": "%s"}|} err_msg)
|
||||
|
||||
@@ -8,7 +8,7 @@ authors: ["Owen Rees<owenrees.dev@gmail.com>"]
|
||||
license: "AGPL-3.0-or-later"
|
||||
tags: ["chess" "pgn" "pdf"]
|
||||
homepage: "https://github.com/therealowenrees/chess-scribe-api"
|
||||
doc: "https://github.com/therealowenrees/chess-scribe-api/README.md"
|
||||
doc: "https://github.com/therealowenrees/chess-scribe-api/blob/main/README.md"
|
||||
bug-reports: "https://github.com/therealowenrees/chess-scribe-api/issues"
|
||||
depends: [
|
||||
"dune" {>= "3.21"}
|
||||
|
||||
@@ -3,7 +3,6 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: chess-scribe-api
|
||||
restart: unless-stopped
|
||||
|
||||
ports:
|
||||
|
||||
Reference in New Issue
Block a user