mirror of
https://github.com/opencontainers/runc.git
synced 2026-11-06 05:17:05 +00:00
Merge pull request #5518 from kolyshkin/ci-bats-install
ci: simplify bats installation
This commit is contained in:
2 files changed
+5
-20
No files matched your search
+2
-3
@@ -53,10 +53,9 @@ RUN useradd -u1000 -m -d/home/rootless -s/bin/bash rootless
|
||||
# install bats
|
||||
ARG BATS_VERSION
|
||||
RUN cd /tmp \
|
||||
&& git clone https://github.com/bats-core/bats-core.git \
|
||||
&& git clone --depth 1 --branch "${BATS_VERSION}" https://github.com/bats-core/bats-core.git \
|
||||
&& cd bats-core \
|
||||
&& git reset --hard "${BATS_VERSION}" \
|
||||
&& ./install.sh /usr/local \
|
||||
&& ./install.sh /usr \
|
||||
&& rm -rf /tmp/bats-core
|
||||
|
||||
ARG RELEASE_ARCHES="386 amd64 arm64 armel armhf ppc64le riscv64 s390x"
|
||||
|
||||
+3
-17
@@ -55,23 +55,9 @@ fi
|
||||
# Install BATS
|
||||
if [ "$PLATFORM_ID" = "platform:el8" ]; then
|
||||
# The packaged version of bats is too old: `BATS_ERROR_SUFFIX: unbound variable`, `bats_require_minimum_version: command not found`
|
||||
(
|
||||
cd /tmp
|
||||
git clone https://github.com/bats-core/bats-core
|
||||
(
|
||||
cd bats-core
|
||||
git checkout "$BATS_VERSION"
|
||||
./install.sh /usr/local
|
||||
cat >>/etc/profile.d/sh.local <<'EOF'
|
||||
PATH="/usr/local/bin:$PATH"
|
||||
export PATH
|
||||
EOF
|
||||
cat >/etc/sudoers.d/local <<'EOF'
|
||||
Defaults secure_path = "/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
|
||||
EOF
|
||||
)
|
||||
rm -rf bats-core
|
||||
)
|
||||
git clone --depth 1 --branch "$BATS_VERSION" https://github.com/bats-core/bats-core /tmp/bats-core
|
||||
/tmp/bats-core/install.sh /usr
|
||||
rm -rf /tmp/bats-core
|
||||
else
|
||||
"${DNF[@]}" install bats
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user