[buildbot] buildmaster: entry.sh: fix errors by checking for dir existence

LEDE Commits lede-commits at lists.infradead.org
Fri Dec 22 02:59:55 PST 2023


ynezz pushed a commit to buildbot.git, branch master:
https://git.openwrt.org/ba9021e3a1160469e2138a0ce17122dd03fafdbd

commit ba9021e3a1160469e2138a0ce17122dd03fafdbd
Author: Petr Štetiar <ynezz at true.cz>
AuthorDate: Fri Dec 22 09:28:40 2023 +0000

    buildmaster: entry.sh: fix errors by checking for dir existence
    
    Get rid of following annyoing errors during testing:
    
      chown: cannot access '/config': No such file or directory
      chown: cannot access '/certs': No such file or directory
      chmod: cannot access '/config': No such file or directory
      chmod: cannot access '/certs': No such file or directory
    
    As those dirs doesn't exist in the container, they're being provided as
    volumes during deployment.
    
    Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
 docker/buildmaster/files/entry.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/docker/buildmaster/files/entry.sh b/docker/buildmaster/files/entry.sh
index 437ad41..2fc914c 100644
--- a/docker/buildmaster/files/entry.sh
+++ b/docker/buildmaster/files/entry.sh
@@ -1,6 +1,10 @@
 #!/usr/bin/env bash
 
-chown --recursive buildbot:buildbot /master /config /certs
-chmod 0700 /master /config /certs
+for dir in /master /config /certs; do
+  [ -d "$dir" ] || continue 
+
+  chown --recursive buildbot:buildbot "$dir"
+  chmod 0700 "$dir"
+done
 
 /usr/sbin/gosu buildbot /start.sh "$@"




More information about the lede-commits mailing list