|
|
|
@@ -1,24 +1,33 @@
|
|
|
|
|
release/build:
|
|
|
|
|
DOT_ENV_FILE=../.env
|
|
|
|
|
|
|
|
|
|
-include ${DOT_ENV_FILE}
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
rm -rf markdown-rs
|
|
|
|
|
rm -rf target
|
|
|
|
|
rm -f Cargo.lock
|
|
|
|
|
|
|
|
|
|
init:
|
|
|
|
|
-git clone https://git.stancik.work/lusk/markdown-rs.git
|
|
|
|
|
|
|
|
|
|
release/build: init
|
|
|
|
|
docker run --rm -it \
|
|
|
|
|
-v "${PWD}":/home/rust/src \
|
|
|
|
|
-v "${PWD}/../markdown-rs":/home/rust/markdown-rs \
|
|
|
|
|
messense/rust-musl-cross:x86_64-musl /bin/sh -c "cargo build --release && chown -R 1000:1001 target"
|
|
|
|
|
-v "${PWD}/markdown-rs":/home/rust/markdown-rs \
|
|
|
|
|
messense/rust-musl-cross:x86_64-musl /bin/sh -c "cargo build --release && chown -R ${SELF_UID}:${SELF_GID} target"
|
|
|
|
|
|
|
|
|
|
debug/build: init
|
|
|
|
|
@docker run --rm -it \
|
|
|
|
|
-v "${PWD}":/home/rust/src \
|
|
|
|
|
-v "${PWD}/markdown-rs":/home/rust/markdown-rs \
|
|
|
|
|
messense/rust-musl-cross:x86_64-musl /bin/sh -c "cargo build && chown -R ${SELF_UID}:${SELF_GID} target"
|
|
|
|
|
|
|
|
|
|
release/install: release/build
|
|
|
|
|
@cp target/x86_64-unknown-linux-musl/release/md_to_html ~/.local/bin/md_to_html
|
|
|
|
|
@cp target/x86_64-unknown-linux-musl/release/md_to_html ../wiki/docker/rootfs/bin/md_to_html
|
|
|
|
|
|
|
|
|
|
debug/build:
|
|
|
|
|
@docker run --rm -it \
|
|
|
|
|
-v "${PWD}":/home/rust/src \
|
|
|
|
|
-v "${PWD}/../markdown-rs":/home/rust/markdown-rs \
|
|
|
|
|
messense/rust-musl-cross:x86_64-musl /bin/sh -c "cargo build && chown -R 1000:1001 target"
|
|
|
|
|
|
|
|
|
|
debug/install: debug/build
|
|
|
|
|
@cp target/x86_64-unknown-linux-musl/debug/md_to_html ~/.local/bin/md_to_html
|
|
|
|
|
@cp target/x86_64-unknown-linux-musl/debug/md_to_html ../wiki/docker/rootfs/bin/md_to_html
|
|
|
|
|
|
|
|
|
|
test: release/install
|
|
|
|
|
@#RUST_LOG=debug cargo run md_to_html
|
|
|
|
|
@RUST_LOG=debug md_to_html convert --file ../wiki/container-data/pages/home.md --to /tmp/output.html
|
|
|
|
|
@cat /tmp/output.html
|
|
|
|
|
run:
|
|
|
|
|
@RUST_LOG=debug md_to_html convert --file test/page.md --to /tmp/test-output.html
|
|
|
|
|
@bat /tmp/test-output.html
|
|
|
|
|