ci/cd - use dynamic random subdomains to bypass LE rate limit
This commit is contained in:
parent
a1e44f6e4b
commit
1bc42204d9
|
@ -138,13 +138,13 @@ jobs:
|
|||
# TYPE: autoconf
|
||||
# secrets:
|
||||
# CICD_SECRETS: ${{ secrets.CICD_SECRETS }}
|
||||
create-infra-swarm:
|
||||
needs: [code-security, build-bw, build-scheduler, build-autoconf]
|
||||
uses: ./.github/workflows/staging-create-infra.yml
|
||||
with:
|
||||
TYPE: swarm
|
||||
secrets:
|
||||
CICD_SECRETS: ${{ secrets.CICD_SECRETS }}
|
||||
# create-infra-swarm:
|
||||
# needs: [code-security, build-bw, build-scheduler, build-autoconf]
|
||||
# uses: ./.github/workflows/staging-create-infra.yml
|
||||
# with:
|
||||
# TYPE: swarm
|
||||
# secrets:
|
||||
# CICD_SECRETS: ${{ secrets.CICD_SECRETS }}
|
||||
# create-infra-k8s:
|
||||
# needs: [code-security, build-bw, build-scheduler, build-autoconf]
|
||||
# uses: ./.github/workflows/staging-create-infra.yml
|
||||
|
@ -184,13 +184,13 @@ jobs:
|
|||
# TYPE: autoconf
|
||||
# RUNS_ON: "['self-hosted', 'bw-autoconf']"
|
||||
# secrets: inherit
|
||||
tests-swarm:
|
||||
needs: [create-infra-swarm]
|
||||
uses: ./.github/workflows/staging-tests.yml
|
||||
with:
|
||||
TYPE: swarm
|
||||
RUNS_ON: "['self-hosted', 'bw-swarm']"
|
||||
secrets: inherit
|
||||
# tests-swarm:
|
||||
# needs: [create-infra-swarm]
|
||||
# uses: ./.github/workflows/staging-tests.yml
|
||||
# with:
|
||||
# TYPE: swarm
|
||||
# RUNS_ON: "['self-hosted', 'bw-swarm']"
|
||||
# secrets: inherit
|
||||
# tests-k8s:
|
||||
# needs: [create-infra-k8s]
|
||||
# uses: ./.github/workflows/staging-tests.yml
|
||||
|
@ -231,14 +231,14 @@ jobs:
|
|||
# TYPE: autoconf
|
||||
# secrets:
|
||||
# CICD_SECRETS: ${{ secrets.CICD_SECRETS }}
|
||||
delete-infra-swarm:
|
||||
if: ${{ always() }}
|
||||
needs: [tests-swarm]
|
||||
uses: ./.github/workflows/staging-delete-infra.yml
|
||||
with:
|
||||
TYPE: swarm
|
||||
secrets:
|
||||
CICD_SECRETS: ${{ secrets.CICD_SECRETS }}
|
||||
# delete-infra-swarm:
|
||||
# if: ${{ always() }}
|
||||
# needs: [tests-swarm]
|
||||
# uses: ./.github/workflows/staging-delete-infra.yml
|
||||
# with:
|
||||
# TYPE: swarm
|
||||
# secrets:
|
||||
# CICD_SECRETS: ${{ secrets.CICD_SECRETS }}
|
||||
# delete-infra-k8s:
|
||||
# if: ${{ always() }}
|
||||
# needs: [tests-k8s]
|
||||
|
|
|
@ -19,11 +19,11 @@ class AutoconfTest(Test):
|
|||
delay=delay,
|
||||
)
|
||||
self._domains = {
|
||||
r"www\.example\.com": getenv("TEST_DOMAIN1"),
|
||||
r"auth\.example\.com": getenv("TEST_DOMAIN1"),
|
||||
r"app1\.example\.com": getenv("TEST_DOMAIN1_1"),
|
||||
r"app2\.example\.com": getenv("TEST_DOMAIN1_2"),
|
||||
r"app3\.example\.com": getenv("TEST_DOMAIN1_3"),
|
||||
r"www\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1"),
|
||||
r"auth\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1"),
|
||||
r"app1\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1_1"),
|
||||
r"app2\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1_2"),
|
||||
r"app3\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1_3")
|
||||
}
|
||||
self._check_domains()
|
||||
|
||||
|
|
|
@ -17,11 +17,11 @@ class DockerTest(Test):
|
|||
delay=delay,
|
||||
)
|
||||
self._domains = {
|
||||
r"www\.example\.com": getenv("TEST_DOMAIN1"),
|
||||
r"auth\.example\.com": getenv("TEST_DOMAIN1"),
|
||||
r"app1\.example\.com": getenv("TEST_DOMAIN1_1"),
|
||||
r"app2\.example\.com": getenv("TEST_DOMAIN1_2"),
|
||||
r"app3\.example\.com": getenv("TEST_DOMAIN1_3"),
|
||||
r"www\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1"),
|
||||
r"auth\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1"),
|
||||
r"app1\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1_1"),
|
||||
r"app2\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1_2"),
|
||||
r"app3\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1_3")
|
||||
}
|
||||
self._check_domains()
|
||||
|
||||
|
|
|
@ -12,11 +12,11 @@ class KubernetesTest(Test):
|
|||
def __init__(self, name, timeout, tests, delay=0):
|
||||
super().__init__(name, "kubernetes", timeout, tests, delay=delay)
|
||||
self._domains = {
|
||||
r"www\.example\.com": getenv("TEST_DOMAIN1_1"),
|
||||
r"auth\.example\.com": getenv("TEST_DOMAIN1_2"),
|
||||
r"app1\.example\.com": getenv("TEST_DOMAIN1"),
|
||||
r"app2\.example\.com": getenv("TEST_DOMAIN2"),
|
||||
r"app3\.example\.com": getenv("TEST_DOMAIN3"),
|
||||
r"www\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1_1"),
|
||||
r"auth\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1_2"),
|
||||
r"app1\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1"),
|
||||
r"app2\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN2"),
|
||||
r"app3\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN3")
|
||||
}
|
||||
|
||||
def init():
|
||||
|
|
|
@ -11,11 +11,11 @@ class LinuxTest(Test):
|
|||
def __init__(self, name, timeout, tests, distro):
|
||||
super().__init__(name, "linux", timeout, tests)
|
||||
self._domains = {
|
||||
r"www\.example\.com": getenv("TEST_DOMAIN1"),
|
||||
r"auth\.example\.com": getenv("TEST_DOMAIN1"),
|
||||
r"app1\.example\.com": getenv("TEST_DOMAIN1_1"),
|
||||
r"app2\.example\.com": getenv("TEST_DOMAIN1_2"),
|
||||
r"app3\.example\.com": getenv("TEST_DOMAIN1_3"),
|
||||
r"www\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1"),
|
||||
r"auth\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1"),
|
||||
r"app1\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1_1"),
|
||||
r"app2\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1_2"),
|
||||
r"app3\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1_3")
|
||||
}
|
||||
if not distro in ("ubuntu", "debian", "fedora", "centos", "rhel"):
|
||||
raise Exception(f"unknown distro {distro}")
|
||||
|
|
|
@ -12,11 +12,11 @@ class SwarmTest(Test):
|
|||
def __init__(self, name, timeout, tests, delay=0):
|
||||
super().__init__(name, "swarm", timeout, tests, delay=delay)
|
||||
self._domains = {
|
||||
r"www\.example\.com": getenv("TEST_DOMAIN1_1"),
|
||||
r"auth\.example\.com": getenv("TEST_DOMAIN1_2"),
|
||||
r"app1\.example\.com": getenv("TEST_DOMAIN1"),
|
||||
r"app2\.example\.com": getenv("TEST_DOMAIN2"),
|
||||
r"app3\.example\.com": getenv("TEST_DOMAIN3"),
|
||||
r"www\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1_1"),
|
||||
r"auth\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1_2"),
|
||||
r"app1\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN1"),
|
||||
r"app2\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN2"),
|
||||
r"app3\.example\.com": Test.random_string(6) + "." + getenv("TEST_DOMAIN3")
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -10,7 +10,8 @@ from re import sub, search, MULTILINE
|
|||
from datetime import datetime
|
||||
from subprocess import run
|
||||
from logger import log
|
||||
|
||||
from string import ascii_lowercase, digits
|
||||
from random import choice
|
||||
|
||||
class Test(ABC):
|
||||
def __init__(self, name, kind, timeout, tests, no_copy_container=False, delay=0):
|
||||
|
@ -172,3 +173,7 @@ class Test(ABC):
|
|||
new_path = sub(old, new, full_path)
|
||||
if full_path != new_path:
|
||||
rename(full_path, new_path)
|
||||
|
||||
def random_string(length) :
|
||||
charset = ascii_lowercase + digits
|
||||
return ''.join(choice(charset) for i in range(length))
|
Loading…
Reference in New Issue