chore(lib): simplify dependency handling
This commit is contained in:
parent
2709d9e3c4
commit
80d43f545a
4 changed files with 28 additions and 42 deletions
17
Dockerfile
17
Dockerfile
|
|
@ -1,27 +1,17 @@
|
|||
FROM data.forgejo.org/oci/node:22-trixie
|
||||
|
||||
ENV PATH=$PATH:/setup-forgejo
|
||||
ENV _CONTAINERS_USERNS_CONFIGURED=""
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get --assume-yes --no-install-recommends install \
|
||||
aardvark-dns \
|
||||
apt-get -y -qq --no-install-recommends install \
|
||||
ca-certificates \
|
||||
curl \
|
||||
daemon \
|
||||
fuse-overlayfs \
|
||||
gettext \
|
||||
git \
|
||||
jq \
|
||||
libcap2-bin \
|
||||
neovim \
|
||||
nftables \
|
||||
passt \
|
||||
podman \
|
||||
podman-compose \
|
||||
podman-docker \
|
||||
procps \
|
||||
pup \
|
||||
slirp4netns \
|
||||
sudo \
|
||||
tcpdump \
|
||||
|
|
@ -39,9 +29,10 @@ RUN apt-get update && \
|
|||
apt-get autoremove --purge && \
|
||||
apt-get autoclean
|
||||
|
||||
COPY --chown=1001:1001 . /e2e
|
||||
COPY lib/dependencies.sh /usr/local/lib
|
||||
RUN bash -c "source /usr/local/lib/dependencies.sh; dependencies"
|
||||
|
||||
RUN git clone https://code.forgejo.org/actions/setup-forgejo.git /setup-forgejo
|
||||
COPY --chown=1001:1001 . /e2e
|
||||
|
||||
USER forgejo-tests
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
SELF_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
SELF="${BASH_SOURCE[0]}"
|
||||
source "$SELF_DIR/lib/lib.sh"
|
||||
source "$SELF_DIR/lib/dependencies.sh"
|
||||
|
||||
source "$SELF_DIR/federation/federation.sh"
|
||||
source "$SELF_DIR/actions/actions.sh"
|
||||
|
|
|
|||
23
lib/dependencies.sh
Normal file
23
lib/dependencies.sh
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
function dependencies() {
|
||||
if ! test -f /usr/local/bin/forgejo-curl.sh; then
|
||||
$SUDO curl --fail -sS https://code.forgejo.org/forgejo/forgejo-curl/raw/branch/main/forgejo-curl.sh -o /usr/local/bin/forgejo-curl.sh
|
||||
$SUDO chmod +x /usr/local/bin/forgejo-curl.sh
|
||||
fi
|
||||
|
||||
if ! which make curl daemon git-lfs jq sqlite3 skopeo podman podman-compose pasta pup >/dev/null; then
|
||||
$SUDO apt-get update -qq
|
||||
$SUDO apt-get install -y -qq --no-install-recommends make curl daemon git-lfs jq sqlite3 skopeo podman podman-compose passt aardvark-dns pup
|
||||
fi
|
||||
|
||||
if ! test -f /usr/local/bin/mc || ! test -f /usr/local/bin/minio; then
|
||||
$SUDO curl --fail https://dl.min.io/client/mc/release/linux-amd64/mc -o /usr/local/bin/mc
|
||||
$SUDO curl --fail https://dl.min.io/server/minio/release/linux-amd64/minio -o /usr/local/bin/minio
|
||||
$SUDO chmod +x /usr/local/bin/mc
|
||||
$SUDO chmod +x /usr/local/bin/minio
|
||||
fi
|
||||
|
||||
if ! test -f /usr/local/bin/garage >/dev/null; then
|
||||
$SUDO curl --fail https://garagehq.deuxfleurs.fr/_releases/v0.8.2/x86_64-unknown-linux-musl/garage -o /usr/local/bin/garage
|
||||
$SUDO chmod +x /usr/local/bin/garage
|
||||
fi
|
||||
}
|
||||
29
lib/lib.sh
29
lib/lib.sh
|
|
@ -43,35 +43,6 @@ function log_info() {
|
|||
echo "$PREFIX $@"
|
||||
}
|
||||
|
||||
function dependencies() {
|
||||
|
||||
if ! test -f /usr/local/bin/forgejo-curl.sh; then
|
||||
$SUDO curl --fail -sS https://code.forgejo.org/forgejo/forgejo-curl/raw/branch/main/forgejo-curl.sh -o /usr/local/bin/forgejo-curl.sh
|
||||
$SUDO chmod +x /usr/local/bin/forgejo-curl.sh
|
||||
fi
|
||||
|
||||
if ! which make curl daemon git-lfs jq sqlite3 skopeo podman podman-compose pup >/dev/null; then
|
||||
$SUDO apt-get update -qq
|
||||
$SUDO apt-get install -y -qq make curl daemon git-lfs jq sqlite3 skopeo podman podman-compose pup
|
||||
fi
|
||||
|
||||
if ! test -f /usr/local/bin/mc || ! test -f /usr/local/bin/minio; then
|
||||
$SUDO curl --fail -sS https://dl.min.io/client/mc/release/linux-amd64/mc -o /usr/local/bin/mc
|
||||
$SUDO curl --fail -sS https://dl.min.io/server/minio/release/linux-amd64/minio -o /usr/local/bin/minio
|
||||
fi
|
||||
if ! test -x /usr/local/bin/mc || ! test -x /usr/local/bin/minio; then
|
||||
$SUDO chmod +x /usr/local/bin/mc
|
||||
$SUDO chmod +x /usr/local/bin/minio
|
||||
fi
|
||||
|
||||
if ! test -f /usr/local/bin/garage >/dev/null; then
|
||||
$SUDO curl --fail -sS https://garagehq.deuxfleurs.fr/_releases/v0.8.2/x86_64-unknown-linux-musl/garage -o /usr/local/bin/garage
|
||||
fi
|
||||
if ! test -x /usr/local/bin/garage >/dev/null; then
|
||||
$SUDO chmod +x /usr/local/bin/garage
|
||||
fi
|
||||
}
|
||||
|
||||
function retry() {
|
||||
rm -f $DIR/wait-for.out
|
||||
success=false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue