sclorg / container-common-scripts

Apache License 2.0
21 stars 45 forks source link

In case of '.git' directory does not exist build and tag is failing. #324

Closed phracek closed 1 year ago

phracek commented 1 year ago

In the case of the '.git' directory does not exist build.sh and tag.sh scripts are failing.

See Nodejs-10 GitLab example, where '.git' directory does not exist:

[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] /var/ARTIFACTS/work-publicsj1cwt8o/public/tree
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] total 56
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] drwxr-xr-x.  6 root root  4096 Feb  8 06:34 .
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] drwxr-xr-x. 10 root root   121 Feb  8 06:34 ..
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] lrwxrwxrwx.  1 root root     1 Feb  8 06:34 10 -> .
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] -rw-r--r--.  1 root root  1240 Feb  8 06:34 bot-cfg.yml
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] -rw-r--r--.  1 root root   114 Feb  8 06:34 cccp.yml
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] -rw-r--r--.  1 root root   319 Feb  8 06:34 ci-config.yml
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] -rw-r--r--.  1 root root   145 Feb  8 06:34 container.yaml
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] -rw-r--r--.  1 root root   664 Feb  8 06:34 content_sets.yml
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] -rw-r--r--.  1 root root    81 Feb  8 06:34 cvp.yml
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] -rw-r--r--.  1 root root  3274 Feb  8 06:34 Dockerfile
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] lrwxrwxrwx.  1 root root    10 Feb  8 06:34 Dockerfile.rhel7 -> Dockerfile
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] lrwxrwxrwx.  1 root root    10 Feb  8 06:34 Dockerfile.rhel8 -> Dockerfile
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] drwxr-xr-x.  2 root root    21 Feb  8 06:34 .fmf
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] -rw-r--r--.  1 root root   359 Feb  8 06:34 gating.yaml
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] -rw-r--r--.  1 root root     0 Feb  8 06:34 .gitignore
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] lrwxrwxrwx.  1 root root     9 Feb  8 06:34 help.md -> README.md
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] -rw-r--r--.  1 root root    31 Feb  8 06:34 .osbs-repo-config
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] -rw-r--r--.  1 root root  1289 Feb  8 06:34 public.fmf
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] -rw-r--r--.  1 root root 10748 Feb  8 06:34 README.md
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] drwxr-xr-x.  3 root root    17 Feb  8 06:34 root
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] drwxr-xr-x.  3 root root    17 Feb  8 06:34 s2i
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] drwxr-xr-x.  7 root root   279 Feb  8 06:34 test
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] 
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] stderr (4 lines)
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] + pwd
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] + ls -la
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] + git status
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] fatal: not a git repository (or any of the parent directories): .git
[11:36:46] [+] [worker_0] [stdout] [RHEL-8.6.0-Nightly:x86_64:/public] 
[11:36:46] [W] [worker_0] [stderr] [RHEL-8.6.0-Nightly:x86_64:/public] Failed to run command: set -eo pipefail; set -x
[11:36:46] [W] [worker_0] [stderr] [RHEL-8.6.0-Nightly:x86_64:/public] pwd
[11:36:46] [W] [worker_0] [stderr] [RHEL-8.6.0-Nightly:x86_64:/public] ls -la
[11:36:46] [W] [worker_0] [stderr] [RHEL-8.6.0-Nightly:x86_64:/public] git status
[11:36:46] [W] [worker_0] [stderr] [RHEL-8.6.0-Nightly:x86_64:/public] ls -al /tmp/container-common-scripts/
[11:36:46] [W] [worker_0] [stderr] [RHEL-8.6.0-Nightly:x86_64:/public] OS=rhel8 VERSIONS=10 /tmp/container-common-scripts/build.sh
[11:36:46] [W] [worker_0] [stderr] [RHEL-8.6.0-Nightly:x86_64:/public] OS=rhel8 VERSIONS=10 /tmp/container-common-scripts/tag.sh