diff --git a/Dockerfile b/Dockerfile index 781aa497..067fdd5a 100644 --- a/Dockerfile +++ b/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 diff --git a/end-to-end.sh b/end-to-end.sh index dc2e3fe6..86c48410 100755 --- a/end-to-end.sh +++ b/end-to-end.sh @@ -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" diff --git a/lib/dependencies.sh b/lib/dependencies.sh new file mode 100644 index 00000000..e1422441 --- /dev/null +++ b/lib/dependencies.sh @@ -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 +} diff --git a/lib/lib.sh b/lib/lib.sh index b1e9409f..efc8b42c 100644 --- a/lib/lib.sh +++ b/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