mirror of
https://github.com/dani-garcia/bw_web_builds.git
synced 2024-10-31 06:44:47 +03:00
0277844cf9
Some misc changes. - Moved old patch files to a `legacy` sub-folder - If a legacy patch is used, show a warning and pause for 10 seconds - Updated the checkout and Dockerfile so both use the same way of cloning the Bitwarden/client repo - Updated the `patch_web_vault.sh` script to try and detect the vault version - Added two new make commands to prepare and release a new version - Added a `.env` feature for the `Makefile` to set some defaults Mainly used for using either `docker` or `podman` and for the GitHub Release script to have a predefined GPG user/key
18 lines
634 B
Bash
18 lines
634 B
Bash
#!/usr/bin/env bash
|
|
# shellcheck disable=SC2034
|
|
set -o pipefail -o errexit
|
|
|
|
VAULT_FOLDER=web-vault
|
|
OUTPUT_FOLDER=builds
|
|
|
|
function get_web_vault_version {
|
|
# First check if we are able to get a tag or branch
|
|
VAULT_VERSION=$(git describe --abbrev=0 --tags --exact-match 2>/dev/null || git branch --show-current)
|
|
# Else we will use the current commit hash
|
|
if [[ -z "${VAULT_VERSION}" ]]; then
|
|
VAULT_VERSION=$(git rev-parse HEAD)
|
|
fi
|
|
# Remove everything up to the first occurrence of "-"
|
|
# The extracted tag could start with either `web-`, `desktop-`, `cli-` or `browser-`
|
|
echo "${VAULT_VERSION#*-}"
|
|
}
|