-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (45 loc) · 1.77 KB
/
Makefile
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
all: upload-images generate deploy
build-docker-image:
docker build -t wordpress-exif .
stop:
docker-compose down
wordpress: stop
docker-compose up -d
frontend:
cd ./source/themes/quis/ && npm start
preprocess:
rm -rf static
mkdir static
mirror:
wget --mirror -p -nH --directory-prefix=static --level=1000 --html-extension -q --show-progress http://localhost:8000/
mirror-frontend:
curl http://localhost:8000/wp-content/themes/quis/css/quis.css > ./static/wp-content/themes/quis/css/quis.css
curl http://localhost:8000/wp-content/themes/quis/js/quis.js > ./static/wp-content/themes/quis/js/quis.js
postprocess:
echo "Removing index.html"
find ./static -name "*.html" -print0 | xargs -0 sed -i'' -e 's/index.html//g'
echo "Removing hostname"
find ./static -name "*.html" -print0 | xargs -0 sed -i'' -e 's/http:\/\/localhost:8000//g'
generate: preprocess other-files mirror postprocess
serve-static:
cd ./static && python3 -m http.server 5555
other-files:
cp ./source/favicon.ico ./static/
cp ./source/keybase.txt ./static/
cp -r ./source/.well-known ./static/
deploy:
aws s3 sync --profile personal --region eu-west-1 ./static s3://quis.cc
upload-images:
aws s3 sync --profile personal --region eu-west-1 ./images s3://images.quis.cc
backup-images:
aws s3 sync --profile personal s3://images.quis.cc ./images
dump-database:
$(eval DATETIME := $(shell echo $$(date +"%Y-%m-%d %H:%M")))
docker exec -it quiscc_db_1 mysqldump -u wordpress -pwordpress wordpress > "./dumps/$(DATETIME).sql"
import-database:
docker exec -i quiscc_db_1 mysql -u wordpress -pwordpress wordpress < $(dump)
sync-database-dumps:
aws s3 sync --profile personal ./dumps s3://quisdbbackups
pull-database-dumps:
aws s3 sync --profile personal s3://quisdbbackups ./dumps
backup-database: dump-database sync-database-dumps