2019-02-12 17:45:44 +01:00
|
|
|
LEKTOR_SERVER_FLAGS=-h 127.0.0.1
|
2019-09-09 21:17:33 +02:00
|
|
|
# minify javascript assets, compile scss assets
|
|
|
|
LEKTOR_PLUGIN_FLAGS=-f scss
|
|
|
|
LEKTOR_DEPLOY_FLAGS=
|
2019-02-12 17:45:44 +01:00
|
|
|
|
|
|
|
all: build
|
|
|
|
|
2019-06-20 14:28:05 +02:00
|
|
|
.ONESHELL:
|
2019-02-12 17:45:44 +01:00
|
|
|
install:
|
2019-06-20 14:28:05 +02:00
|
|
|
if hash apt-get 2>/dev/null; then
|
2020-02-06 22:34:29 +01:00
|
|
|
sudo apt-get update -qq >/dev/null && sudo apt-get install -qq apt-utils imagemagick python3-pip python3-setuptools gcc git-lfs
|
2019-06-20 14:28:05 +02:00
|
|
|
elif hash pacman 2>/dev/null; then
|
2020-02-06 22:34:29 +01:00
|
|
|
sudo pacman -Syu imagemagick python-pip glibc lib32-glibc gcc git-lfs --noconfirm
|
2019-06-20 14:28:05 +02:00
|
|
|
elif hash dnf 2>/dev/null; then
|
2020-02-06 22:34:29 +01:00
|
|
|
sudo dnf install -y ImageMagick python3-pip gcc git-lfs
|
2019-06-20 14:28:05 +02:00
|
|
|
else
|
2020-02-06 22:34:29 +01:00
|
|
|
echo -e "Please install Imagemagick, python3-pip git-lfs and gcc"
|
2019-06-20 14:28:05 +02:00
|
|
|
fi
|
2020-02-06 22:34:29 +01:00
|
|
|
pip3 install wheel --user --upgrade
|
|
|
|
pip3 install lektor --user --upgrade
|
2019-03-11 13:16:01 +01:00
|
|
|
|
2019-02-12 17:45:44 +01:00
|
|
|
|
2019-06-20 14:28:05 +02:00
|
|
|
build:
|
|
|
|
lektor clean --yes
|
2019-09-09 21:17:33 +02:00
|
|
|
lektor plugin flush-cache
|
2019-09-13 10:08:14 +02:00
|
|
|
python3 -m lektor build $(LEKTOR_PLUGIN_FLAGS)
|
2019-02-12 17:45:44 +01:00
|
|
|
|
|
|
|
server:
|
2019-09-13 10:08:14 +02:00
|
|
|
python3 -m lektor server $(LEKTOR_SERVER_FLAGS) $(LEKTOR_PLUGIN_FLAGS)
|
2019-09-09 21:17:33 +02:00
|
|
|
|
|
|
|
deploy:
|
|
|
|
lektor clean --yes
|
|
|
|
lektor plugin flush-cache
|
|
|
|
lektor build $(LEKTOR_PLUGIN_FLAGS) $(LEKTOR_DEPLOY_FLAGS)
|
|
|
|
lektor deploy $(LEKTOR_PLUGIN_FLAGS) $(LEKTOR_DEPLOY_FLAGS)
|
2019-12-22 11:54:48 +01:00
|
|
|
|
|
|
|
pull:
|
|
|
|
if git config remote.github.url > /dev/null; then
|
|
|
|
git pull github master
|
|
|
|
else
|
|
|
|
git remote add github git@github.com:c3woc/c3woc-website.git
|
|
|
|
git pull github master
|
|
|
|
fi
|
|
|
|
if git config remote.gitea.url > /dev/null; then
|
|
|
|
git pull gitea master
|
|
|
|
else
|
|
|
|
git remote add gitea gitea@gitea.see-base.de:C3WOC/c3woc-webseite.git
|
|
|
|
git pull gitea master
|
|
|
|
fi
|
2019-12-22 12:05:11 +01:00
|
|
|
git pull origin master
|
2019-12-22 11:59:04 +01:00
|
|
|
|
|
|
|
push:
|
2020-02-07 01:00:30 +01:00
|
|
|
rm .lfsconfig
|
2019-12-22 11:59:04 +01:00
|
|
|
if git config remote.gitea.url > /dev/null; then
|
|
|
|
git push gitea master
|
|
|
|
else
|
|
|
|
git remote add gitea gitea@gitea.see-base.de:C3WOC/c3woc-webseite.git
|
|
|
|
git push gitea master
|
|
|
|
fi
|
|
|
|
if git config remote.github.url > /dev/null; then
|
|
|
|
git push github master
|
|
|
|
else
|
|
|
|
git remote add github git@github.com:c3woc/c3woc-website.git
|
|
|
|
git push github master
|
|
|
|
fi
|
2020-02-07 01:00:30 +01:00
|
|
|
git restore .lfsconfig
|