summaryrefslogtreecommitdiff
path: root/misc/vaultpress.makefile
blob: 6fe69892355c1da723247f5a0a448e1ec7058f8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
WP_PATH = $(patsubst %/,%,$(HTML_DIR)/$(WP_INSTALL_DIR))

wp-includes = $(WP_PATH)/wp-includes

$(wp-includes):
	$(DOCKER) run --rm -- docker.io/library/wordpress:$(WP_IMAGE_TAG) tar -cf - --exclude wp-content . \
		| tar -C $(WP_PATH) -xvf -

.PHONY: extract
extract: | $(wp-includes)
	$(if $(wildcard $(file)),,$(error usage: make extract file=<Tar file from VaultPress>))
	$(TAR) -C $(SQL_DIR)/ -xvzf $(file) --strip-components 1 sql/
	$(TAR) -C $(WP_PATH)/ -xvzf $(file) --exclude sql/ --exclude wp-config.php
	[[ -e "$(WP_PATH)/wp-config.php" ]] || \
		$(TAR) -C $(WP_PATH)/ -xvzf $(file) wp-config.php