Made build.sh more robust
This commit is contained in:
parent
101380b195
commit
358d8e0b50
12
build.sh
12
build.sh
@ -5,15 +5,21 @@ set -e
|
|||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
SRC="$DIR/git"
|
SRC="$DIR/git"
|
||||||
DST="$DIR/dist"
|
DST="$DIR/dist"
|
||||||
if [ -z "$1" ]; then REF="master"; else REF="$1"; fi
|
if [ -z "$1" ]; then REF="1.10.0"; else REF="$1"; fi
|
||||||
|
|
||||||
# Clone bitwarden_rs
|
# Clone bitwarden_rs
|
||||||
if [ ! -d "$SRC" ]; then
|
if [ ! -d "$SRC" ]; then
|
||||||
git clone https://github.com/dani-garcia/bitwarden_rs.git "$SRC"
|
git clone https://github.com/dani-garcia/bitwarden_rs.git "$SRC"
|
||||||
fi
|
fi
|
||||||
cd "$SRC" || exit
|
cd "$SRC" || exit
|
||||||
|
CREF="$(git branch | grep \* | cut -d ' ' -f2)"
|
||||||
|
if [ "$CREF" != "$REF" ]; then
|
||||||
git fetch
|
git fetch
|
||||||
git checkout "$REF"
|
git checkout "$REF" --force
|
||||||
|
else
|
||||||
|
git clean -d -f
|
||||||
|
git pull
|
||||||
|
fi
|
||||||
cd - || exit
|
cd - || exit
|
||||||
|
|
||||||
# Prepare EnvFile
|
# Prepare EnvFile
|
||||||
@ -25,7 +31,7 @@ sed -i "s#\# WEB_VAULT_FOLDER=web-vault/#WEB_VAULT_FOLDER=/usr/share/bitwarden_r
|
|||||||
mkdir -p "$DST"
|
mkdir -p "$DST"
|
||||||
|
|
||||||
# Prepare Dockerfile
|
# Prepare Dockerfile
|
||||||
patch -i "$DIR/Dockerfile.patch" "$SRC/docker/amd64/sqlite/Dockerfile" -o "$DIR/Dockerfile"
|
patch -i "$DIR/Dockerfile.patch" "$SRC/docker/amd64/sqlite/Dockerfile" -o "$DIR/Dockerfile" || exit
|
||||||
|
|
||||||
docker build -t bitwarden-deb "$DIR"
|
docker build -t bitwarden-deb "$DIR"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user