2022-06-02 11:26:42 -07:00
|
|
|
SHELL := bash
|
|
|
|
.ONESHELL:
|
|
|
|
.SHELLFLAGS := -eu -o pipefail -c
|
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
|
|
|
|
help:
|
2022-07-15 07:40:21 -07:00
|
|
|
@echo "Use either: clean, checkout, patch-web-vault, generate-patch, build, tar, or full"
|
2023-12-18 09:09:47 -07:00
|
|
|
@echo "Or for container builds use: container or container-extract"
|
|
|
|
@echo
|
|
|
|
@echo "By default docker is used, you can force podman by using podman or podman-extract"
|
|
|
|
@echo "You can also define the default via a '.env' file, see the '.env.template' for details"
|
|
|
|
@echo
|
|
|
|
@echo "For releasing a new version you can use gh-prepare and gh-release"
|
|
|
|
@echo
|
2022-06-02 11:26:42 -07:00
|
|
|
.PHONY: help
|
|
|
|
|
2023-12-18 09:09:47 -07:00
|
|
|
# Load .env variables if the file exists
|
|
|
|
ifneq (,$(wildcard ./.env))
|
|
|
|
include .env
|
|
|
|
export
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Force docker to output the progress in plain
|
|
|
|
BUILDKIT_PROGRESS=plain
|
|
|
|
|
|
|
|
ifndef CONTAINER_CMD
|
|
|
|
CONTAINER_CMD = docker
|
|
|
|
endif
|
|
|
|
|
2022-06-02 11:26:42 -07:00
|
|
|
clean:
|
2023-12-18 09:09:47 -07:00
|
|
|
rm -rvf ./web-vault
|
|
|
|
rm -rvf ./builds
|
|
|
|
rm -rvf ./docker_builds
|
|
|
|
rm -rvf ./container_builds
|
|
|
|
rm -vf ./bw_web_v*.tar.gz*
|
|
|
|
rm -vf sha256sums.txt
|
2022-06-02 11:26:42 -07:00
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
checkout:
|
|
|
|
./scripts/checkout_web_vault.sh
|
|
|
|
.PHONY: checkout
|
|
|
|
|
|
|
|
patch-web-vault:
|
|
|
|
./scripts/patch_web_vault.sh
|
|
|
|
.PHONY: patch-web-vault
|
|
|
|
|
|
|
|
generate-patch:
|
|
|
|
./scripts/generate_patch_file.sh
|
|
|
|
.PHONY: generate-patch
|
|
|
|
|
|
|
|
build:
|
|
|
|
./scripts/build_web_vault.sh
|
2022-10-30 05:19:00 -07:00
|
|
|
.PHONY: build
|
2022-06-02 11:26:42 -07:00
|
|
|
|
|
|
|
tar:
|
|
|
|
./scripts/tar_web_vault.sh
|
|
|
|
.PHONY: tar
|
|
|
|
|
|
|
|
full: checkout patch-web-vault build tar
|
|
|
|
.PHONY: full
|
|
|
|
|
2023-12-18 09:09:47 -07:00
|
|
|
container:
|
|
|
|
${CONTAINER_CMD} build -t bw_web_vault .
|
|
|
|
.PHONY: container
|
|
|
|
|
|
|
|
container-extract: container
|
|
|
|
@${CONTAINER_CMD} rm bw_web_vault_extract 2>/dev/null || true
|
|
|
|
@${CONTAINER_CMD} create --name bw_web_vault_extract bw_web_vault
|
|
|
|
@mkdir -vp container_builds
|
|
|
|
@rm -rf ./container_builds/bw_web_vault.tar.gz ./container_builds/web-vault
|
|
|
|
@${CONTAINER_CMD} cp bw_web_vault_extract:/bw_web_vault.tar.gz ./container_builds/bw_web_vault.tar.gz
|
|
|
|
@${CONTAINER_CMD} cp bw_web_vault_extract:/web-vault ./container_builds/web-vault
|
|
|
|
@${CONTAINER_CMD} rm bw_web_vault_extract || true
|
|
|
|
.PHONY: container-extract
|
|
|
|
|
|
|
|
# Alias for container forcing docker
|
|
|
|
docker: CONTAINER_CMD := docker
|
|
|
|
docker: container
|
2022-06-02 11:26:42 -07:00
|
|
|
.PHONY: docker
|
|
|
|
|
2023-12-18 09:09:47 -07:00
|
|
|
# Alias for container forcing docker
|
|
|
|
docker-extract: CONTAINER_CMD := docker
|
|
|
|
docker-extract: container-extract
|
2022-06-02 11:26:42 -07:00
|
|
|
.PHONY: docker-extract
|
2023-12-18 09:09:47 -07:00
|
|
|
|
|
|
|
# Alias for container forcing podman
|
|
|
|
podman: CONTAINER_CMD := podman
|
|
|
|
podman: container
|
|
|
|
.PHONY: podman
|
|
|
|
|
|
|
|
# Alias for container forcing podman
|
|
|
|
podman-extract: CONTAINER_CMD := podman
|
|
|
|
podman-extract: container-extract
|
|
|
|
.PHONY: podman-extract
|
|
|
|
|
|
|
|
# This part is used for extracing and release a new version on Github
|
|
|
|
gh-prepare:
|
|
|
|
./scripts/gh_prepare.sh
|
|
|
|
.PHONY: gh-prepare
|
|
|
|
|
|
|
|
gh-release:
|
|
|
|
./scripts/gh_release.sh
|
|
|
|
.PHONY: gh-release
|