Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path adjustment and cleanup #8

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions bin/trento-install-checks
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
# in regular deployments using docker
#

checks_src="/usr/local/src/trento-checks/checks"
checks_src="/usr/src/trento-checks/checks"
checks_dst="/usr/share/trento/checks"

if [ -d "$checks_dst" ] && [ -n "$(find "$checks_dst" -maxdepth 0 -type d -empty 2>/dev/null)" ]; then
mkdir -p "$checks_dst"

if [ -n "$(find "$checks_dst" -maxdepth 0 -type d -empty 2>/dev/null)" ]; then
if [ ! -d "$checks_src" ]; then
echo "Make sure the checks are installed to $checks_src" 1>&2
echo "Make sure the checks are available at $checks_src" 1>&2

# FIXME: handle via trap
unset checks_src
Expand All @@ -21,7 +23,7 @@ if [ -d "$checks_dst" ] && [ -n "$(find "$checks_dst" -maxdepth 0 -type d -empty
exit 1
fi

install -p -m 0644 "$checks_src"/* "$checks_dst" || echo "Make sure $checks_dst exists, is empty and accessible" 1>&2
install -p -m 0644 "$checks_src"/* "$checks_dst"

# FIXME: handle via trap
unset checks_src
Expand All @@ -30,7 +32,7 @@ if [ -d "$checks_dst" ] && [ -n "$(find "$checks_dst" -maxdepth 0 -type d -empty
exit $?
fi

echo "Make sure $checks_dst exists, is empty and accessible" 1>&2
echo "Make sure $checks_dst is empty and accessible" 1>&2
janvhs marked this conversation as resolved.
Show resolved Hide resolved

# FIXME: handle via trap
unset checks_src
Expand Down
28 changes: 19 additions & 9 deletions packaging/suse/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,31 @@ FROM bci/bci-base:15.4

LABEL org.opencontainers.image.source="https://github.com/trento-project/checks"

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# If set to C, LC_ALL takes precedence
ENV LC_ALL C.UTF-8

# tar is required by kubectl cp
RUN zypper --non-interactive in -y tar && \
zypper --non-interactive clean

ADD checks.tar.gz /build/

RUN mkdir -p /usr/local/src/trento-checks
RUN mkdir --mode=0600 /tmp/trento-checks-build

RUN mv /build/checks/checks /usr/local/src/trento-checks/checks
WORKDIR /tmp/trento-checks-build

RUN mv /build/checks/bin/trento-install-checks /usr/local/bin/trento-install-checks
RUN chmod +x /usr/local/bin/trento-install-checks
# checks.tar.gz is provided by OBS (build.opensuse.org)
ADD checks.tar.gz .

RUN install --directory --mode=0755 /usr/src/trento-checks
RUN install --directory --mode=0755 /usr/src/trento-checks/checks
RUN install --preserve-timestamps --mode=0644 ./checks/checks/* /usr/src/trento-checks/checks
RUN install --preserve-timestamps --mode=0755 ./checks/bin/trento-install-checks /usr/bin/trento-install-checks


WORKDIR /

RUN rm -r /tmp/trento-checks-build


ENTRYPOINT ["/usr/bin/trento-install-checks"]

ENTRYPOINT ["/usr/local/bin/trento-install-checks"]