From d15e6c8ad85b652274a8a5f948fe4aa20743dd13 Mon Sep 17 00:00:00 2001 From: "D. Lee" Date: Tue, 14 Feb 2023 16:10:04 -0800 Subject: [PATCH] Fix doc to build a local image for microk8s (#594) - add push to registry cmd - update to frontend_* and backend_* --- docs/deploy/local.md | 12 +++++------- scripts/build-backend.sh | 3 +++ scripts/build-frontend.sh | 4 ++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/deploy/local.md b/docs/deploy/local.md index dfed9ece..273cc913 100644 --- a/docs/deploy/local.md +++ b/docs/deploy/local.md @@ -137,8 +137,8 @@ By default, this setup will pull the latest release of Browsertrix Cloud. Howeve First, open `./chart/examples/local-config.yaml` and add the following, which will ensure only local images are used: ``` -api_pull_policy: "Never" -nginx_pull_policy: "Never" +backend_pull_policy: "Never" +frontend_pull_policy: "Never" ``` Now, rebuild either the backend and/or frontend images locally. The exact process depends on the Kubernetes deployment in use: @@ -153,13 +153,13 @@ Now, rebuild either the backend and/or frontend images locally. The exact proces MicroK8s uses its own container registry, running on port 32000. - 1. Set `export REGISTRY=localhost:32000/` and then run `./scripts/build-backend.sh` and/or `./scripts/build-frontend.sh` to rebuild the images into the MicroK8S registry. + 1. Set `export REGISTRY=localhost:32000/` and then run `./scripts/build-backend.sh` and/or `./scripts/build-frontend.sh` to rebuild the images into the MicroK8S registry. 2. In `./chart/examples/local-config.yaml`, uncomment out one or both of the following lines to use the local images: ``` - api_image: "localhost:32000/webrecorder/browsertrix-backend:latest" - nginx_image: "localhost:32000/webrecorder/browsertrix-frontend:latest" + backend_image: "localhost:32000/webrecorder/browsertrix-backend:latest" + frontend_image: "localhost:32000/webrecorder/browsertrix-frontend:latest" ``` ??? tip "Minikube" @@ -198,5 +198,3 @@ Now, rebuild either the backend and/or frontend images locally. The exact proces ``` Once the images have been built and any other config changes made per the above instructions, simply run the `helm upgrade...` command again to restart with local images. - - diff --git a/scripts/build-backend.sh b/scripts/build-backend.sh index 4eef9c32..6e7763a9 100755 --- a/scripts/build-backend.sh +++ b/scripts/build-backend.sh @@ -3,3 +3,6 @@ CURR=$(dirname "${BASH_SOURCE[0]}") docker build -t ${REGISTRY}webrecorder/browsertrix-backend:latest $CURR/../backend/ +if [ -n "$REGISTRY" ]; then + docker push ${REGISTRY}webrecorder/browsertrix-backend +fi diff --git a/scripts/build-frontend.sh b/scripts/build-frontend.sh index 2cf9656f..b1fa01d2 100755 --- a/scripts/build-frontend.sh +++ b/scripts/build-frontend.sh @@ -2,3 +2,7 @@ CURR=$(dirname "${BASH_SOURCE[0]}") docker build --build-arg GIT_COMMIT_HASH="$(git rev-parse --short HEAD)" --build-arg GIT_BRANCH_NAME="$(git rev-parse --abbrev-ref HEAD)" --build-arg --load -t ${REGISTRY}webrecorder/browsertrix-frontend:latest $CURR/../frontend/ + +if [ -n "$REGISTRY" ]; then + docker push ${REGISTRY}webrecorder/browsertrix-frontend +fi