Improve deployment info
This commit is contained in:
parent
f16116bd30
commit
49f92cb144
3 changed files with 60 additions and 31 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
||||||
# lektor
|
# lektor
|
||||||
packages/
|
packages/
|
||||||
|
lektor/
|
||||||
|
|
||||||
# ---> Vim
|
# ---> Vim
|
||||||
# swap
|
# swap
|
||||||
|
|
81
Makefile
81
Makefile
|
@ -3,55 +3,80 @@ LEKTOR_SERVER_FLAGS=-h 127.0.0.1
|
||||||
LEKTOR_PLUGIN_FLAGS=-f scss -f pretifyhtml
|
LEKTOR_PLUGIN_FLAGS=-f scss -f pretifyhtml
|
||||||
LEKTOR_DEPLOY_FLAGS=
|
LEKTOR_DEPLOY_FLAGS=
|
||||||
|
|
||||||
|
.PHONY: all install venv build server deploy pull push
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
.ONESHELL:
|
|
||||||
install:
|
install:
|
||||||
if hash apt-get 2>/dev/null; then
|
if hash apt-get 2>/dev/null; then \
|
||||||
sudo apt-get update -qq >/dev/null && sudo apt-get install -qq apt-utils imagemagick python3-pip python3-setuptools gcc git-lfs
|
apt-get update -qq >/dev/null && apt-get install -qq apt-utils imagemagick python3-pip python3-setuptools gcc git-lfs python3-venv rsync dos2unix; \
|
||||||
elif hash pacman 2>/dev/null; then
|
elif hash pacman 2>/dev/null; then \
|
||||||
sudo pacman -Syu imagemagick python-pip glibc lib32-glibc gcc git-lfs --noconfirm
|
pacman -Syu imagemagick python-pip glibc lib32-glibc gcc git-lfs python3-venv rsync dos2unix --noconfirm; \
|
||||||
elif hash dnf 2>/dev/null; then
|
elif hash dnf 2>/dev/null; then \
|
||||||
sudo dnf install -y ImageMagick python3-pip gcc git-lfs
|
dnf install -y ImageMagick python3-pip gcc git-lfs rsync dos2unix; \
|
||||||
else
|
else \
|
||||||
echo -e "Please install Imagemagick, python3-pip git-lfs and gcc"
|
echo -e "Please install Imagemagick, python3-pip git-lfs, python3-venv, rsync, gcc and dos2unix"; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
venv:
|
||||||
|
if [ -z "${VIRTUAL_ENV}" ]; then \
|
||||||
|
printf "Run '\033[0;33mpython3 -m venv lektor\033[0;37m' to create venv.\nRun '\033[0;33msource lektor/bin/activate\033[0;37m' to activate venv.\n"; \
|
||||||
|
printf "Run '\033[0;33mpip3 install wheel --upgrade\033[0;37m' next.\nRun '\033[0;33mpip3 install lektor --upgrade\033[0;37m' to install lektor\n"; \
|
||||||
fi
|
fi
|
||||||
sudo pip3 install wheel --upgrade
|
|
||||||
sudo pip3 install lektor --upgrade
|
|
||||||
echo -e "Pleas make sure you have unix2dos available!"
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
if python3 -m lektor --version 2>/dev/null; then
|
if [ -z "${VIRTUAL_ENV}" ]; then \
|
||||||
python3 -m lektor build $(LEKTOR_PLUGIN_FLAGS)
|
printf "Run 'source lektor/bin/activate' to enable venv. Or 'make install' to create venv"; \
|
||||||
else
|
else \
|
||||||
lektor build $(LEKTOR_PLUGIN_FLAGS)
|
if python3 -m lektor --version 2>/dev/null; then \
|
||||||
|
python3 -m lektor build $(LEKTOR_PLUGIN_FLAGS); \
|
||||||
|
else \
|
||||||
|
lektor build $(LEKTOR_PLUGIN_FLAGS); \
|
||||||
|
fi; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
server:
|
server:
|
||||||
if python3 -m lektor --version 2>/dev/null; then
|
if [ -z "${VIRTUAL_ENV}" ]; then \
|
||||||
python3 -m lektor server $(LEKTOR_SERVER_FLAGS) $(LEKTOR_PLUGIN_FLAGS)
|
printf "Run 'source lektor/bin/activate' to enable venv. Or 'make install' to create venv"; \
|
||||||
else
|
else \
|
||||||
lektor server $(LEKTOR_SERVER_FLAGS) $(LEKTOR_PLUGIN_FLAGS)
|
if python3 -m lektor --version 2>/dev/null; then \
|
||||||
|
python3 -m lektor server $(LEKTOR_SERVER_FLAGS) $(LEKTOR_PLUGIN_FLAGS); \
|
||||||
|
else \
|
||||||
|
lektor server $(LEKTOR_SERVER_FLAGS) $(LEKTOR_PLUGIN_FLAGS); \
|
||||||
|
fi; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
lektor clean --yes
|
if [ -z "${VIRTUAL_ENV}" ]; then \
|
||||||
lektor plugin flush-cache
|
printf "Run 'source lektor/bin/activate' to enable venv. Or 'make install' to create venv"; \
|
||||||
lektor build $(LEKTOR_PLUGIN_FLAGS) $(LEKTOR_DEPLOY_FLAGS)
|
else \
|
||||||
|
lektor plugin flush-cache; \
|
||||||
|
lektor clean --yes; \
|
||||||
|
rm assets/svg/*; \
|
||||||
|
if python3 -m lektor --version 2>/dev/null; then \
|
||||||
|
python3 -m lektor build $(LEKTOR_PLUGIN_FLAGS) $(LEKTOR_DEPLOY_FLAGS); \
|
||||||
unix2dos temp/builds/c3woc.de/waffeln.ics
|
unix2dos temp/builds/c3woc.de/waffeln.ics
|
||||||
lektor deploy $(LEKTOR_PLUGIN_FLAGS) $(LEKTOR_DEPLOY_FLAGS)
|
python3 -m lektor deploy $(LEKTOR_PLUGIN_FLAGS) $(LEKTOR_DEPLOY_FLAGS); \
|
||||||
|
else \
|
||||||
|
lektor build $(LEKTOR_PLUGIN_FLAGS) $(LEKTOR_DEPLOY_FLAGS); \
|
||||||
|
unix2dos temp/builds/c3woc.de/waffeln.ics
|
||||||
|
lektor deploy $(LEKTOR_PLUGIN_FLAGS) $(LEKTOR_DEPLOY_FLAGS); \
|
||||||
|
fi; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
pull:
|
pull:
|
||||||
if git config remote.github.url > /dev/null; then
|
if git config remote.github.url > /dev/null; then
|
||||||
git pull github main
|
git pull github main
|
||||||
else
|
else
|
||||||
git remote add github git@github.com:c3woc/c3woc-website.git
|
git remote add github https://github.com/c3woc/c3woc-website.git
|
||||||
git pull github main
|
git pull github main
|
||||||
fi
|
fi
|
||||||
if git config remote.backwesen.url > /dev/null; then
|
if git config remote.backwesen.url > /dev/null; then
|
||||||
git pull backwesen main
|
git pull backwesen main
|
||||||
else
|
else
|
||||||
git remote add backwesen gitea@backwesen.de:c3woc/webseite.git
|
git remote add backwesen https://backwesen.de/c3woc/webseite.git
|
||||||
git pull backwesen main
|
git pull backwesen main
|
||||||
fi
|
fi
|
||||||
git pull origin main
|
git pull origin main
|
||||||
|
@ -60,12 +85,12 @@ push:
|
||||||
if git config remote.github.url > /dev/null; then
|
if git config remote.github.url > /dev/null; then
|
||||||
git push github main
|
git push github main
|
||||||
else
|
else
|
||||||
git remote add github git@github.com:c3woc/c3woc-website.git
|
git remote add github https://github.com/c3woc/c3woc-website.git
|
||||||
git push github main
|
git push github main
|
||||||
fi
|
fi
|
||||||
if git config remote.backwesen.url > /dev/null; then
|
if git config remote.backwesen.url > /dev/null; then
|
||||||
git push backwesen main
|
git push backwesen main
|
||||||
else
|
else
|
||||||
git remote add backwesen gitea@backwesen.de:l3d/webseite.git
|
git remote add backwesen https://backwesen.de/l3d/webseite.git
|
||||||
git push github main
|
git push github main
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -35,7 +35,7 @@ Dieses ruft ihr so auf:
|
||||||
sudo apt install git-lfs
|
sudo apt install git-lfs
|
||||||
|
|
||||||
# clont das git (hier von gitea)
|
# clont das git (hier von gitea)
|
||||||
git clone https://gitea.see-base.de/C3WOC/c3woc-webseite.git
|
git clone https://backwesen.de/c3woc/webseite.git
|
||||||
|
|
||||||
# installiere make um das Makefile auszuführen
|
# installiere make um das Makefile auszuführen
|
||||||
sudo apt install make
|
sudo apt install make
|
||||||
|
@ -43,8 +43,11 @@ sudo apt install make
|
||||||
# betrete das geklonte repo:
|
# betrete das geklonte repo:
|
||||||
cd c3woc-webseite
|
cd c3woc-webseite
|
||||||
|
|
||||||
# installiere lektor + abhängigkeiten
|
# installiere abhängigkeiten
|
||||||
make install
|
make install
|
||||||
|
|
||||||
|
# Insturctions how to create venv
|
||||||
|
make venv
|
||||||
```
|
```
|
||||||
|
|
||||||
Zur C3WOC Webseite etwas beitragen:
|
Zur C3WOC Webseite etwas beitragen:
|
||||||
|
|
Loading…
Reference in a new issue