Skip to content

Commit

Permalink
Spread the cron schedules across the whole day
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
  • Loading branch information
s0undt3ch committed Sep 22, 2023
1 parent 5429b67 commit 379c2c5
Show file tree
Hide file tree
Showing 30 changed files with 34 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/.container.template.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "<{ name }> 🐳 <% if is_mirror -%> Mirror <%- else %>Container<% endif %
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 <{ cron_hour }> * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/almalinux-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "AlmaLinux 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 17 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/amazonlinux-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Amazon Linux 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 16 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/archlinux-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "ArchLinux 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 14 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/busybox-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "BusyBox 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 13 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/centos-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "CentOS 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 12 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/centos-stream-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "CentOS Stream 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 11 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/consul-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Consul 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 10 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/debian-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Debian 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 9 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/etcd-v2-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Etcd v2 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 8 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/etcd-v3-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Etcd v3 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 7 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fedora-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Fedora 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 6 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mariadb-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "MariaDB 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 5 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mysql-server-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "MySQL Server 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 4 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/openldap-minion-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "OpenLDAP Minion 🐳 Container"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 22 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/opensuse-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Opensuse 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 3 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/packaging-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Salt Packaging 🐳 Container"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 19 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/percona-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Percona 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 2 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/photon-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Photon 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 1 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rabbitmq-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "RabbitMQ 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 23 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/redis-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Redis 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 22 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/salt-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Salt Releases 🐳 Container"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 23 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/salt-gitfs-http-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Salt GitFS HTTP Server 🐳 Container"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 20 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ssh-minion-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "SSH Minion 🐳 Container"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 21 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tinyproxy-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Tinyproxy 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 21 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Ubuntu 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 20 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vault-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Vault 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 19 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/virt-minion-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Virt Minion 🐳 Container"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 18 * * *"
push:
branches:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zookeeper-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Apache ZooKeeper 🐳 Mirror"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 15 * * *"
push:
branches:
- '*'
Expand Down
5 changes: 5 additions & 0 deletions tasks/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def generate(ctx, ghcr_org="saltstack/salt-ci-containers"):

custom_headers_included = False
mirrors_header_included = False
cron_hour_range = list(range(0, 24))
for name, details in containers:
is_mirror = details["is_mirror"]

Expand Down Expand Up @@ -140,6 +141,9 @@ def generate(ctx, ghcr_org="saltstack/salt-ci-containers"):
"linux/mips64le",
]
exclude_platforms.extend(details.get("exclude_platforms") or [])
cron_hour = cron_hour_range.pop()
if not cron_hour_range:
cron_hour_range = list(range(0, 24))
jinja_context = {
"name": name,
"slug": details["name"],
Expand All @@ -148,6 +152,7 @@ def generate(ctx, ghcr_org="saltstack/salt-ci-containers"):
"workflow_file_name": workflow_file_name,
"multiarch": details.get("multiarch", True),
"exclude_platforms": ",".join(exclude_platforms),
"cron_hour": cron_hour,
}
workflows_dir = utils.REPO_ROOT / ".github" / "workflows"
workflow_path = workflows_dir / workflow_file_name
Expand Down

0 comments on commit 379c2c5

Please sign in to comment.