-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
32 lines (25 loc) · 996 Bytes
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
IMAGE := "xls2csv"
build-linux: docker-build-linux
just run-linux "gcc xls2csv.c -static \
/usr/local/musl/lib/libxlsxio_read.a \
/usr/local/musl/lib/libxlsxio_write.a \
/usr/local/musl/lib/libexpat.a \
/usr/local/lib/libminizip.a \
/usr/local/musl/lib/libz.a \
-pthread -DBUILD_XLSXIO_STATIC -O3 \
-o xls2csv-linux \
&& strip xls2csv-linux"
# extract executable built in previous step to host by calling just task 'run' below
sudo chown $(id -u):$(id -g) xls2csv-linux
# build the xls2csv executable
docker-build-linux:
docker build -t "{{IMAGE}}:linux" .
test:
./xls2csv-linux < example.xlsx
./xls2csv-linux example.xlsx
# build and extract from container, then install the xls2csv executable on host
install: docker-build-linux
sudo install -v -m755 xls2csv /usr/local/bin
# run command inside container, mounting current dir as working dir
run-linux +cmd:
docker run -it --rm -v "$(pwd):/app" -w /app "{{IMAGE}}:linux" bash -c '{{cmd}}'