1
0
mirror of https://github.com/jakeswenson/BitBetter.git synced 2023-10-10 13:36:57 +02:00
BitBetter/build.sh

26 lines
1.2 KiB
Bash
Raw Normal View History

#!/bin/sh
2017-10-22 19:08:50 +02:00
DIR=`dirname "$0"`
DIR=`exec 2>/dev/null;(cd -- "$DIR") && cd -- "$DIR"|| cd "$DIR"; unset PWD; /usr/bin/pwd || /bin/pwd || pwd`
BW_VERSION="$(curl --silent "https://api.github.com/repos/bitwarden/server/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')"
echo "Building BitBetter for BitWarden version $BW_VERSION"
# If there aren't any keys, generate them first.
[ -e "$DIR/.keys/cert.cert" ] || "$DIR/.keys/generate-keys.sh"
2017-10-29 17:57:49 +01:00
[ -e "$DIR/src/bitBetter/.keys" ] || mkdir "$DIR/src/bitBetter/.keys"
2017-10-29 17:57:49 +01:00
cp "$DIR/.keys/cert.cert" "$DIR/src/bitBetter/.keys"
2017-10-29 17:57:49 +01:00
docker run --rm -v "$DIR/src/bitBetter:/bitBetter" -w=/bitBetter mcr.microsoft.com/dotnet/core/sdk:3.1 sh build.sh
2017-10-29 17:57:49 +01:00
docker build --no-cache --build-arg BITWARDEN_TAG=bitwarden/api:$BW_VERSION -t bitbetter/api "$DIR/src/bitBetter" # --squash
docker build --no-cache --build-arg BITWARDEN_TAG=bitwarden/identity:$BW_VERSION -t bitbetter/identity "$DIR/src/bitBetter" # --squash
docker tag bitbetter/api bitbetter/api:latest
docker tag bitbetter/identity bitbetter/identity:latest
docker tag bitbetter/api bitbetter/api:$BW_VERSION
docker tag bitbetter/identity bitbetter/identity:$BW_VERSION
2017-10-29 17:57:49 +01:00