Skip to content

Commit 0ab4b8f

Browse files
committed
build: add git folder to safe.directory to avoid error
To make sure the git describe command works, we need to add the current folder to safe.directory. Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
1 parent 1c52007 commit 0ab4b8f

4 files changed

Lines changed: 18 additions & 1 deletion

File tree

build-aux/release

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,24 @@
44
# SPDX-License-Identifier: GPL-2.0-or-later
55

66
import datetime
7+
import os
78
import subprocess
89

910

1011
def run(*args):
11-
return subprocess.check_output(args).decode().strip()
12+
out = None
13+
try:
14+
out = subprocess.run(args, stderr=subprocess.STDOUT)
15+
except subprocess.CalledProcessError as e:
16+
print(f"Error running command: {' '.join(args)}")
17+
print(f"Output: {e.output}")
18+
return out.decode().strip()
1219

1320

1421
# Get a human readable name of this commit:
1522
# - build from tag: v2.4.5
1623
# - build without a tag: v2.4.5-3-gc238eff
24+
##run("git", "config", "--global", "--add", "safe.directory", os.getcwd())
1725
commit_name = run("git", "describe", "--tags", "--match", "v[0-9]*")
1826

1927
if "-" in commit_name:

containers/centos-9.containerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ RUN echo v1 \
3030
xfsprogs \
3131
&& dnf clean all
3232

33+
# Workaround for https://github.com/geerlingguy/docker-rockylinux9-ansible/issues/6
34+
RUN chmod 0400 /etc/shadow
35+
3336
# Developemnt tools.
3437
COPY requirements.txt requirements.txt
3538
RUN python3 -m pip install --upgrade --ignore-installed pip \

containers/fedora-40.containerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ RUN echo v1 \
3232
&& depmod $(basename /lib/modules/*) \
3333
&& dnf clean all
3434

35+
# Workaround for https://github.com/geerlingguy/docker-rockylinux9-ansible/issues/6
36+
RUN chmod 0400 /etc/shadow
37+
3538
# Developemnt tools.
3639
COPY requirements.txt requirements.txt
3740
RUN python3 -m pip install --upgrade pip \

containers/fedora-41.containerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ RUN echo v1 \
3232
&& depmod $(basename /lib/modules/*) \
3333
&& dnf clean all
3434

35+
# Workaround for https://github.com/geerlingguy/docker-rockylinux9-ansible/issues/6
36+
RUN chmod 0400 /etc/shadow
37+
3538
# Developemnt tools.
3639
COPY requirements.txt requirements.txt
3740
RUN python3 -m pip install --upgrade pip \

0 commit comments

Comments
 (0)