From c418d7560986a82c8121fb7ee9c62eb624d214f3 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Wed, 17 Jun 2026 01:31:19 +0200 Subject: [PATCH] Fix and upgrade GitlabCI --- build_scripts/GitlabCI/base.Dockerfile | 10 +++------- build_scripts/GitlabCI/getRepoArgs.sh | 21 ++++++++++++++------- build_scripts/GitlabCI/gitlabCI.Dockerfile | 10 ++++++---- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/build_scripts/GitlabCI/base.Dockerfile b/build_scripts/GitlabCI/base.Dockerfile index 5fd1bd81d..a6092aae8 100644 --- a/build_scripts/GitlabCI/base.Dockerfile +++ b/build_scripts/GitlabCI/base.Dockerfile @@ -12,7 +12,7 @@ ## To run the container # docker run -it -p 127.0.0.1:9092:9092 "${CI_REGISTRY_IMAGE}" retroshare-service --jsonApiPort 9092 --jsonApiBindAddress 0.0.0.0 -FROM ubuntu:22.04 +FROM ubuntu:26.04 ENV DEBIAN_FRONTEND=noninteractive ENV APT_UNAT="--assume-yes --quiet" @@ -26,7 +26,7 @@ RUN apt-get update $APT_UNAT && \ libsqlite3-dev libsqlcipher-dev \ pkg-config libz-dev \ libxapian-dev doxygen rapidjson-dev \ - git cmake curl python3 + git cmake curl python3 libasio-dev libjson-c-dev libbotan-3-dev ## Avoid git cloning spuriously failing with # server certificate verification failed. CAfile: none CRLfile: none @@ -48,11 +48,7 @@ RUN git clone $REPO_DEPTH $REPO_URL -b $REPO_BRANCH && \ git fetch --tags && \ git submodule update --init \ libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ \ - supportlibs/restbed/ && \ - cd supportlibs/restbed/ && \ - git submodule update --init \ - dependency/asio/ dependency/kashmir/ && \ - cd ../../../ + supportlibs/restbed/ RUN \ mkdir RetroShare-build && cd RetroShare-build && \ diff --git a/build_scripts/GitlabCI/getRepoArgs.sh b/build_scripts/GitlabCI/getRepoArgs.sh index 8794524e1..eef44c04e 100755 --- a/build_scripts/GitlabCI/getRepoArgs.sh +++ b/build_scripts/GitlabCI/getRepoArgs.sh @@ -1,9 +1,16 @@ #!/bin/sh -[ -n "$CI_MERGE_REQUEST_ID" ] && - echo \ - --build-arg REPO_URL="$CI_MERGE_REQUEST_SOURCE_PROJECT_URL" \ - --build-arg REPO_BRANCH="$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" || - echo \ - --build-arg REPO_URL="$CI_REPOSITORY_URL" \ - --build-arg REPO_BRANCH="$CI_COMMIT_BRANCH" +# Emit --build-arg flags so gitlabCI.Dockerfile fetches the EXACT ref that +# triggered the pipeline. REPO_REF can be a commit SHA (the CI default), a +# branch name, or a tag. The remote URL is still chosen per-case so +# MR-from-fork fetches from the fork. + +if [ -n "$CI_MERGE_REQUEST_ID" ]; then + REPO_URL="$CI_MERGE_REQUEST_SOURCE_PROJECT_URL" +else + REPO_URL="$CI_REPOSITORY_URL" +fi + +echo \ + --build-arg REPO_URL="$REPO_URL" \ + --build-arg REPO_REF="$CI_COMMIT_SHA" diff --git a/build_scripts/GitlabCI/gitlabCI.Dockerfile b/build_scripts/GitlabCI/gitlabCI.Dockerfile index 5ae3f4ed3..0f4277251 100644 --- a/build_scripts/GitlabCI/gitlabCI.Dockerfile +++ b/build_scripts/GitlabCI/gitlabCI.Dockerfile @@ -3,13 +3,15 @@ FROM registry.gitlab.com/retroshare/retroshare:base RUN apt-get update -y && apt-get upgrade -y ARG REPO_URL=https://github.com/RetroShare/RetroShare.git -ARG REPO_BRANCH=master +ARG REPO_REF=master RUN \ cd RetroShare && git remote add testing $REPO_URL && \ - git fetch --tags testing $REPO_BRANCH && \ - git reset --hard testing/$REPO_BRANCH && \ + git fetch --tags testing $REPO_REF && \ + git checkout --force FETCH_HEAD && \ + git submodule deinit -f --all && \ git submodule update --init \ - libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ && \ + libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ \ + supportlibs/restbed/ && \ git --no-pager log --max-count 1 RUN \ mkdir RetroShare-build && cd RetroShare-build && \