From 04f0dc4d93f3c55fbcc291e828614f387ec6d351 Mon Sep 17 00:00:00 2001
From: xZero707 <aleksandar@puharic.com>
Date: Sun, 9 Apr 2023 21:58:01 +0200
Subject: [PATCH] Improve formatting, order and docs

---
 build/docker-bake.hcl | 44 +++++++++++++++++++++++++++++++------------
 1 file changed, 32 insertions(+), 12 deletions(-)

diff --git a/build/docker-bake.hcl b/build/docker-bake.hcl
index 03e8b67..1e76c52 100644
--- a/build/docker-bake.hcl
+++ b/build/docker-bake.hcl
@@ -1,11 +1,39 @@
 group "default" {
-  targets = ["5_9_0", "5_9_1", "5_9_2", "5_9_3", "6_0_0", "6_0_1", "6_0_2", "6_0_3", "6_1_0", "6_1_1", "6_2_0"]
+  targets = [
+    "5_9_0",
+    "5_9_1",
+    "5_9_2",
+    "5_9_3",
+    "6_0_0",
+    "6_0_1",
+    "6_0_2",
+    "6_0_3",
+    "6_1_0",
+    "6_1_1",
+    "6_2_0"
+  ]
+}
+
+target "build-dockerfile" {
+  dockerfile = "Dockerfile"
+}
+
+target "build-platforms" {
+  platforms = ["linux/amd64", "linux/armhf", "linux/aarch64"]
+}
+
+target "build-common" {
+  pull = true
 }
 
 variable "REGISTRY_CACHE" {
   default = "docker.io/nlss/wordpress-cache"
 }
 
+######################
+# Define the functions
+######################
+
 # Get the arguments for the build
 function "get-args" {
   params = [version]
@@ -51,17 +79,9 @@ function "get-tags" {
   )
 }
 
-target "build-dockerfile" {
-  dockerfile = "Dockerfile"
-}
-
-target "build-platforms" {
-  platforms = ["linux/amd64", "linux/armhf", "linux/aarch64"]
-}
-
-target "build-common" {
-  pull = true
-}
+##########################
+# Define the build targets
+##########################
 
 target "5_9_0" {
   inherits   = ["build-dockerfile", "build-platforms", "build-common"]