From cd0d70b8f6c4eadc1eacae8499497564c16b5639 Mon Sep 17 00:00:00 2001 From: bunkerity Date: Wed, 22 Jun 2022 14:32:27 +0200 Subject: [PATCH] cache dev Linux images in ci/cd and disable site config generation for autoconf/swarm/k8s --- .github/workflows/dev.yml | 8 ++++++++ helpers/entrypoint.sh | 3 +++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 4ec4821..7847f2c 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -188,6 +188,8 @@ jobs: platforms: linux/amd64 push: true tags: ${{ secrets.PRIVATE_REGISTRY }}/infra/bunkerweb-ubuntu:latest + cache-from: type=registry,ref=bunkerity/cache:bw-ubuntu-cache + cache-to: type=registry,ref=bunkerity/cache:bw-ubuntu-cache,mode=min # Build linux debian build-bw-debian: @@ -219,6 +221,8 @@ jobs: platforms: linux/amd64 push: true tags: ${{ secrets.PRIVATE_REGISTRY }}/infra/bunkerweb-debian:latest + cache-from: type=registry,ref=bunkerity/cache:bw-debian-cache + cache-to: type=registry,ref=bunkerity/cache:bw-debian-cache,mode=min # Build linux centos build-bw-centos: @@ -250,6 +254,8 @@ jobs: platforms: linux/amd64 push: true tags: ${{ secrets.PRIVATE_REGISTRY }}/infra/bunkerweb-centos:latest + cache-from: type=registry,ref=bunkerity/cache:bw-centos-cache + cache-to: type=registry,ref=bunkerity/cache:bw-centos-cache,mode=min # Build linux fedora build-bw-fedora: @@ -281,6 +287,8 @@ jobs: platforms: linux/amd64 push: true tags: ${{ secrets.PRIVATE_REGISTRY }}/infra/bunkerweb-fedora:latest + cache-from: type=registry,ref=bunkerity/cache:bw-fedora-cache + cache-to: type=registry,ref=bunkerity/cache:bw-fedora-cache,mode=min # Run tests tests: diff --git a/helpers/entrypoint.sh b/helpers/entrypoint.sh index e6705e1..6dd13d7 100644 --- a/helpers/entrypoint.sh +++ b/helpers/entrypoint.sh @@ -77,6 +77,9 @@ fi # generate final configuration export TEMP_NGINX="no" log "ENTRYPOINT" "ℹ️" "Generating configuration ..." +if [ "$SWARM_MODE" = "yes" ] || [ "$KUBERNETES_MODE" = "yes" ] || [ "$AUTOCONF_MODE" = "yes" ] ; then + export SERVER_NAME= +fi env | grep -E -v "^(HOSTNAME|PWD|PKG_RELEASE|NJS_VERSION|SHLVL|PATH|_|NGINX_VERSION|HOME)=" > "/tmp/variables.env" /opt/bunkerweb/gen/main.py --settings /opt/bunkerweb/settings.json --templates /opt/bunkerweb/confs --output /etc/nginx --variables /tmp/variables.env if [ "$?" -ne 0 ] ; then