mirror of
https://github.com/jakeswenson/BitBetter.git
synced 2023-10-10 13:36:57 +02:00
7d8f0b1082
* Exclude cert.cert from git * Use latest release of bitwarden as base image (#67, #66) * Add a script which simplifies Bitwarden updates * fix typo * Add UseApi * Updated version, created update section * Workaround for docker-compose --ignore-pull-failures bugs (4377 and 7127) * use version from docker script * check if bitbetter images are outdated * Make Sso available in org license Add `UseSso` var and enable * Update README.md Co-authored-by: Christoph Haas <christoph.h@sprinternet.at> Co-authored-by: Lework <kuailemy123@163.com> Co-authored-by: Captainhook <ec14018@qmul.ac.uk>
26 lines
1.2 KiB
Bash
Executable File
26 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
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://raw.githubusercontent.com/bitwarden/server/master/scripts/bitwarden.sh | grep 'COREVERSION="' | sed 's/^[^"]*"//; s/".*//')"
|
|
|
|
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"
|
|
|
|
[ -e "$DIR/src/bitBetter/.keys" ] || mkdir "$DIR/src/bitBetter/.keys"
|
|
|
|
cp "$DIR/.keys/cert.cert" "$DIR/src/bitBetter/.keys"
|
|
|
|
docker run --rm -v "$DIR/src/bitBetter:/bitBetter" -w=/bitBetter mcr.microsoft.com/dotnet/core/sdk:3.1 sh build.sh
|
|
|
|
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
|
|
|