Skip to content

Commit

Permalink
remove obsolete stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Arne Hilmann committed Apr 29, 2022
1 parent a09d117 commit a8fd9f1
Showing 1 changed file with 13 additions and 79 deletions.
92 changes: 13 additions & 79 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,43 @@ SVGBOB_VERSION=0.5.0-alpha.6

VERSION=0.60.0
MOTTO=rusty version
PDF_VERSION=0.11
STANDALONE_VERSION=0.5
FRIENDS_VERSION=0.5
A2SKETCH_VERSION=0.15
JUPYTER_VERSION=0.4


# all: docroot pandocs
.PHONY: all target/binaries/markdeck.x86_64-apple-darwin target/binaries/markdeck.x86_64-unknown-linux-musl
all: docroot pandocs binaries docker-image


debug:
time cargo build


pandocs: src/docroot/pandoc-x86_64-apple-darwin src/docroot/pandoc-x86_64-unknown-linux-musl


src/docroot/pandoc-x86_64-apple-darwin:
curl -OL https://github.com/jgm/pandoc/releases/download/$(PANDOC_VERSION)/pandoc-$(PANDOC_VERSION)-macOS.zip
unzip -p pandoc-$(PANDOC_VERSION)-macOS.zip pandoc-$(PANDOC_VERSION)/bin/pandoc > $@
chmod a+rx $@
rm -f pandoc-$(PANDOC_VERSION)-macOS.zip


src/docroot/pandoc-x86_64-unknown-linux-musl:
curl -OL https://github.com/jgm/pandoc/releases/download/$(PANDOC_VERSION)/pandoc-$(PANDOC_VERSION)-linux-amd64.tar.gz
tar zxvOf pandoc-$(PANDOC_VERSION)-linux-amd64.tar.gz pandoc-$(PANDOC_VERSION)/bin/pandoc > $@
chmod a+rx $@
rm -f pandoc-$(PANDOC_VERSION)-linux-amd64.tar.gz


binaries: target/binaries/markdeck.x86_64-apple-darwin target/binaries/markdeck.x86_64-unknown-linux-musl


target/binaries/markdeck.x86_64-apple-darwin:
export TARGET=x86_64-apple-darwin
time cargo build --release --target $${TARGET}
mkdir -p target/binaries
cp target/$${TARGET}/release/markdeck $@


target/binaries/markdeck.x86_64-unknown-linux-musl:
export CC_x86_64_unknown_linux_musl=x86_64-unknown-linux-musl-gcc
export CXX_x86_64_unknown_linux_musl=x86_64-unknown-linux-musl-g++
Expand All @@ -64,29 +65,27 @@ target/binaries/markdeck.x86_64-unknown-linux-musl:
cp target/$${TARGET}/release/markdeck $@



docker-image:
docker build -f docker/Dockerfile.markdeck target/binaries -t arne/markdeck:$(VERSION)


push-image:
docker push arne/markdeck:$(VERSION)
docker tag arne/markdeck:$(VERSION) quay.io/arne/markdeck:$(VERSION)
docker push quay.io/arne/markdeck:$(VERSION)


run-as-container:
mkdir -p example/test
# docker run -it -v $(PWD)/example/:/source:ro -v $(PWD)/example/test/:/target -p 8080:8080 markdeck:$(VERSION)
docker rm -f markdeck
docker run -it -v $(PWD)/example/:/source:ro -p 8080:8080 -e RUST_LOG=debug --name markdeck markdeck:$(VERSION)


debug-container:
docker exec -it markdeck ash



# all: docker-compose.yaml develop.yaml images.built


images.built: Makefile docker/Dockerfile.*
cp target/binaries/markdeck.x86_64-unknown-linux-musl ./
docker compose build \
Expand Down Expand Up @@ -141,69 +140,12 @@ docroot: src/docroot/main/toplevel/admin.html src/docroot/main/assets/3rdparty/j
docker export docroot-helper | tar -C src/docroot/live_server/helper --strip-components 1 -x docroot/


tag: all
tag:
@echo $(VERSION)
git tag -a v$(VERSION) -m v$(VERSION)
git push --tags


push: all
for I in $(shell yq r docker-compose.yaml 'services.*.image' | uniq); do
echo pushing $$I
docker push $$I
docker tag $$I quay.io/$$I
docker push quay.io/$$I
done


docker-compose.yaml: docker-compose.yaml.source Makefile
cp docker-compose.yaml.source docker-compose.yaml
yq eval '.services.markdeck.image = "arne/markdeck-pandoc:$(VERSION)"' -i docker-compose.yaml
yq eval '.services.markdeck.build.args.version = "$(VERSION)"' -i docker-compose.yaml
yq eval '.services.markdeck.build.args.motto = "$(MOTTO)"' -i docker-compose.yaml
yq eval '.services.pdf.image = "arne/markdeck-decktape:$(PDF_VERSION)"' -i docker-compose.yaml
yq eval '.services.standalone.image = "arne/markdeck-standalone:$(STANDALONE_VERSION)"' -i docker-compose.yaml
yq eval '.services.friends.image = "arne/markdown-friends:$(FRIENDS_VERSION)"' -i docker-compose.yaml
yq eval '.services.a2sketch.image = "arne/a2sketch:$(A2SKETCH_VERSION)"' -i docker-compose.yaml
yq eval '.services.jupyter.image = "arne/markdeck-jupyter:$(JUPYTER_VERSION)"' -i docker-compose.yaml
yq eval '.services.jupyterlab.image = "arne/markdeck-jupyter:$(JUPYTER_VERSION)"' -i docker-compose.yaml


develop.yaml: develop.yaml.source Makefile
cp develop.yaml.source develop.yaml
yq eval '.services.markdeck.image = "arne/markdeck-pandoc:$(VERSION)"' -i docker-compose.yaml
yq eval '.services.pdf.image = "arne/markdeck-decktape:$(PDF_VERSION)"' -i docker-compose.yaml
yq eval '.services.standalone.image = "arne/markdeck-standalone:$(STANDALONE_VERSION)"' -i docker-compose.yaml
yq eval '.services.friends.image = "arne/markdown-friends:$(FRIENDS_VERSION)"' -i docker-compose.yaml
yq eval '.services.a2sketch.image = "arne/a2sketch:$(A2SKETCH_VERSION)"' -i docker-compose.yaml
yq eval '.services.jupyter.image = "arne/markdeck-jupyter:$(JUPYTER_VERSION)"' -i docker-compose.yaml
yq eval '.services.jupyterlab.image = "arne/markdeck-jupyter:$(JUPYTER_VERSION)"' -i docker-compose.yaml


../markdeck: docker-compose.yaml Makefile
sed -n '/EODCF/,/EODCF/{/EODCF/d;s/..MARKDECK_USER/______/;p;}' ../markdeck > dc.tmp
yq eval '.services.markdeck.image = "arne/markdeck-pandoc:$(VERSION)"' -i dc.tmp
yq eval '.services.markdeck.build.args.version = "$(VERSION)"' -i dc.tmp
yq eval 'del(.services.markdeck.build)' -i dc.tmp
yq eval 'del(.services.web.build)' -i dc.tmp
yq eval '.services.pdf.image = "arne/markdeck-decktape:$(PDF_VERSION)"' -i dc.tmp
yq eval 'del(.services.pdf.build)' -i dc.tmp
yq eval '.services.standalone.image = "arne/markdeck-standalone:$(STANDALONE_VERSION)"' -i dc.tmp
yq eval 'del(.services.standalone.build)' -i dc.tmp
yq eval '.services.friends.image = "arne/markdown-friends:$(FRIENDS_VERSION)"' -i dc.tmp
yq eval 'del(.services.friends.build)' -i dc.tmp
yq eval '.services.a2sketch.image = "arne/a2sketch:$(A2SKETCH_VERSION)"' -i dc.tmp
yq eval 'del(.services.jupyter.build)' -i dc.tmp
yq eval '.services.jupyter.image = "arne/markdeck-jupyter:$(JUPYTER_VERSION)"' -i dc.tmp
yq eval 'del(.services.jupyterlab.build)' -i dc.tmp
yq eval '.services.jupyterlab.image = "arne/markdeck-jupyter:$(JUPYTER_VERSION)"' -i dc.tmp
sed -i.bak 's/______/\\$$MARKDECK_USER/' dc.tmp
sed -i.bak -e '/ EODCF/r dc.tmp' -e '/ EODCF/,/EODCF/{/EODCF/p;d;}' ../markdeck
rm -f dc.tmp* ../markdeck.bak
sed -i.bak '/VERSION=/{s/=.*/=$(VERSION)/;}' ../markdeck
rm -f ../markdeck.bak


check-versions:
@echo "PANDOC_VERSION"
@echo "$(PANDOC_VERSION)"
Expand Down Expand Up @@ -246,15 +188,6 @@ target/versions: Makefile
echo "MERMAID_VERSION=$(MERMAID_VERSION)" >> $@
echo "SVGBOB_VERSION=$(SVGBOB_VERSION)" >> $@

markdeck/versions: Makefile
rm -f $@
echo "PANDOC_VERSION=$(PANDOC_VERSION)" >> $@
echo "REVEALJS_VERSION=$(REVEALJS_VERSION)" >> $@
echo "ASCIINEMAPLAYER_VERSION=$(ASCIINEMAPLAYER_VERSION)" >> $@
echo "JQUERY_VERSION=$(JQUERY_VERSION)" >> $@
echo "IMPRESSJS_VERSION=$(IMPRESSJS_VERSION)" >> $@
echo "MERMAID_VERSION=$(MERMAID_VERSION)" >> $@
echo "SVGBOB_VERSION=$(SVGBOB_VERSION)" >> $@

update-rust:
rustup self update
Expand All @@ -273,6 +206,7 @@ update-rust:
brew upgrade mingw-w64 || brew install mingw-w64
rustup target add x86_64-pc-windows-gnu


clean:
rm -f downloaded/bin/*
rm -rf markdeck/assets/3rdparty markdeck/assets/framework
Expand All @@ -283,4 +217,4 @@ tabularasa:
docker images "arne/markdeck*"
docker images -q "arne/markdeck*" | xargs docker rmi -f
docker system prune -f
docker images "arne/markdeck*"
docker images "arne/markdeck*"

0 comments on commit a8fd9f1

Please sign in to comment.