Dockerize build

This commit is contained in:
Tommy Wang 2020-06-17 15:06:57 -05:00 committed by Nikita Prokopov
parent 6fc75b41f9
commit f967f62036
7 changed files with 28 additions and 8 deletions

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM python:3
WORKDIR /opt
RUN pip install -U Pillow==5.4.1 idna==2.8 requests==2.21.0 urllib3==1.24.1
RUN pip install pycairo
RUN pip install git+https://github.com/googlefonts/gftools
RUN pip install fontmake
RUN apt-get update && \
apt-get install -y ttfautohint && \
apt-get install -y woff2 && \
apt-get install -y sfnt2woff-zopfli
RUN pip install fontbakery

7
Makefile Normal file
View File

@ -0,0 +1,7 @@
all: dep build
dep:
docker build -t fira:latest .
build:
docker run --rm -v ${PWD}:/opt fira:latest ./script/build

View File

@ -1,6 +1,6 @@
#!/bin/bash -e
source venv/bin/activate
[ -d venv ] && source venv/bin/activate
# ============================================================================
# VARIABLE FONT ==============================================================
@ -87,4 +87,4 @@ mkdir -p distr/woff
woffs=$(ls distr/*/*.woff)
for woff in $woffs; do
mv $woff distr/woff/$(basename $woff)
done
done

View File

@ -1,6 +1,6 @@
#!/bin/bash -euo pipefail
source venv/bin/activate
[ -d venv ] && source venv/bin/activate
args=( "$@" )
default_weights=( "Light" "Regular" "Retina" "Medium" "SemiBold" "Bold" )

View File

@ -2,7 +2,7 @@
cd "`dirname $0`/.."
source venv/bin/activate
[ -d venv ] && source venv/bin/activate
DIR=distr/variable_ttf
FILE=FiraCode-VF.ttf

View File

@ -2,7 +2,7 @@
# requires sfnt2woff-zopfli (get from https://github.com/bramstein/homebrew-webfonttools)
cd "`dirname $0`/.."
source venv/bin/activate
[ -d venv ] && source venv/bin/activate
rm -rf distr/*/*.woff
@ -14,4 +14,4 @@ done
mkdir -p distr/woff
mv distr/*/*.woff distr/woff
rm distr/woff/FiraCode-Retina.woff
rm distr/woff/FiraCode-Retina.woff

View File

@ -2,7 +2,7 @@
# requires woff2_compress (get from https://github.com/bramstein/homebrew-webfonttools)
cd "`dirname $0`/.."
source venv/bin/activate
[ -d venv ] && source venv/bin/activate
rm -rf distr/*/*.woff2
@ -13,4 +13,4 @@ done
mkdir -p distr/woff2
mv distr/*/*.woff2 distr/woff2
rm distr/woff2/FiraCode-Retina.woff2
rm distr/woff2/FiraCode-Retina.woff2