Skip to content

Commit

Permalink
ci: update commands
Browse files Browse the repository at this point in the history
  • Loading branch information
mrKazzila committed Jan 1, 2025
1 parent c82f274 commit 43ca4cd
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions Justfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,48 @@
#!/usr/bin/env just --justfile

# ===== Base variables =====
PROJECT_NAME := "resume"
DC := "docker-compose"
DC_FILE := "docker-compose.yml"
DC_COMMAND := "docker-compose -p resume -f docker/docker-compose.yml"


# ===== Base =====
help:
@echo "Available commands:"
@echo " run - Run the latex Docker container to build the resume"
@echo " run_linter - Run the chktex linter Docker container"
@echo " run_format - Run the latex Docker container for formatting"
@echo " up - Build the resume builder Docker container"
@echo " down - Down the resume builder Docker container"
@echo " rebuild - Rebuild all Docker containers"
@echo " help - Show this help message"


# ===== Docker automation =====
run:
@echo "[j] Run the latex Docker container ..."
{{DC}} run -d --rm latex bash -c "pdflatex -output-directory=/output resume.tex"
@{{DC_COMMAND}} run -d --rm latex bash -c "pdflatex -output-directory=/output resume.tex"
@echo "[j] Done!"

run_linter:
@echo "[j] Run the chktex(linter) Docker container ..."
-{{DC}} run -d --rm chktex
@{{DC_COMMAND}} run -d --rm chktex
@echo "[j] Done! Check /output/chktex_output.log for details."

run_format:
@echo "[j] Run the latex Docker container with formatting ..."
{{DC}} run -d --rm latex
@{{DC_COMMAND}} run -d --rm latex
@echo "[j] Done!"

up:
@echo "[j] Run the url api Docker container ..."
{{DC}} -p {{PROJECT_NAME}} -f {{DC_FILE}} up -d --build
@echo "[j] Build the resume builder Docker container ..."
{{DC_COMMAND}} up -d --build
@echo "[j] Success up!"

down:
@echo "[j] Stop the url api Docker container ..."
{{DC}} -p {{PROJECT_NAME}} -f {{DC_FILE}} down
@echo "[j] Down the resume builder Docker container ..."
{{DC_COMMAND}} down
@echo "[j] Success down!"

rebuild:
@echo "[m] Rebuild all Docker containers ..."
{{DC}} -p {{PROJECT_NAME}} -f {{DC_FILE}} up -d --build --force-recreate
{{DC_COMMAND}} up -d --build --force-recreate
@echo "[m] Rebuild complete!"

0 comments on commit 43ca4cd

Please sign in to comment.