[Git][java-team/jmagick][master] Add rdeps

Bastien Roucariès (@rouca) gitlab at salsa.debian.org
Thu Sep 26 20:23:18 BST 2024



Bastien Roucariès pushed to branch master at Debian Java Maintainers / jmagick


Commits:
9ab7aac5 by Bastien Roucariès at 2024-09-26T19:23:00+00:00
Add rdeps

- - - - -


2 changed files:

- + debian/rdeps-ci.yml
- debian/salsa-ci.yml


Changes:

=====================================
debian/rdeps-ci.yml
=====================================
@@ -0,0 +1,131 @@
+.rdep-build-before-script: &rdep-build-before-script |
+   # Reported in https://salsa.debian.org/salsa-ci-team/pipeline/issues/104,
+   # GitLab can only expand variables once. So at the beginning CCACHE_WORK_DIR
+   # was assigned to `${WORKING_DIR}/.ccache`, and it will be expanded as
+   # `$CI_PROJECT_DIR/debian/output/.ccache`, so it creates a folder named
+   # "\$CI_PROJECT_DIR", which is then saved as build cache. To allow smooth
+   # transition, that wrongly named folder has to be removed:
+   rm -rf '$CI_PROJECT_DIR'
+
+   # salsa-ci-team/pipeline#107
+   rm -rf ${CI_PROJECT_DIR}/debian/output/.ccache
+
+   mkdir -p ${WORKING_DIR} ${CCACHE_WORK_DIR}
+
+   # https://salsa.debian.org/salsa-ci-team/pipeline/-/merge_requests/230
+   rm -rf ${CCACHE_TMP_DIR}
+
+   mv ${CCACHE_WORK_DIR} ${CCACHE_TMP_DIR}
+   add_extra_repository.sh -v -e "${SALSA_CI_EXTRA_REPOSITORY}" -k "${SALSA_CI_EXTRA_REPOSITORY_KEY}"
+
+
+.rdep-build-script: &rdep-build-script |
+   export CCACHE_DIR=${CCACHE_TMP_DIR}
+   # Add deb-src entries
+   sed -i 's/^Types:.*/Types: deb deb-src/' /etc/apt/sources.list.d/debian.sources
+   apt-get update && eatmydata apt-get install --no-install-recommends -y \
+     aptitude \
+     devscripts \
+     ccache \
+     equivs \
+     fakeroot \
+     build-essential \
+     apt-utils
+
+   # install built packages repo
+   (set -e; cd "${WORKING_DIR}"; mkdir -p dists/salsa/main/; cd dists/salsa/main/; ln -s ../../.. binary-amd64)
+   tee "${WORKING_DIR}/apt-salsa-release.conf" <<EOF
+   APT::FTPArchive::Release::Origin "SalsaCI";
+   APT::FTPArchive::Release::Label "SalsaCI internal rdeps";
+   APT::FTPArchive::Release::Codename "salsa";
+   APT::FTPArchive::Release::Architectures "amd64";
+   APT::FTPArchive::Release::Components "main";
+   APT::FTPArchive::Release::Description "Salsa CI internal repo";
+   EOF
+   tee "${WORKING_DIR}/apt-ftparchive.conf" <<EOF
+   Dir {
+    ArchiveDir ".";
+    CacheDir ".";
+   };
+   Default {
+    Packages::Compress ". gzip bzip2";
+    Sources::Compress "gzip bzip2";
+    Contents::Compress "gzip bzip2";
+   };
+   BinDirectory "dists/salsa/main/binary-amd64" {
+    Packages "dists/salsa/main/binary-amd64/Packages";
+    Contents "dists/salsa/Contents-amd64";
+   };
+   Tree "dists/salsa" {
+    Sections "main";
+    Architectures "amd64";
+   };
+   Default {
+    Packages {
+      Extensions ".deb";
+    };
+   };
+   EOF
+   (set -e; cd "${WORKING_DIR}"; apt-ftparchive generate apt-ftparchive.conf)
+   (set -e; cd "${WORKING_DIR}"; apt-ftparchive -c apt-salsa-release.conf release dists/salsa/ >dists/salsa/Release)
+   tee  /etc/apt/sources.list.d/build.sources <<EOF
+   Types: deb
+   URIs: file://${WORKING_DIR}
+   Suites: salsa
+   Components: main contrib non-free non-free-firmware
+   Trusted: yes
+   EOF
+   apt update
+   # install build dep
+   apt -y build-dep ${REVERSE_DEP}
+   # download source
+   cd ${WORKING_DIR}
+   # Generate ccache links
+   dpkg-reconfigure ccache
+   PATH="/usr/lib/ccache/:${PATH}"
+   # Reset ccache stats
+   ccache -z
+   # Create salsaci user and fix permissions
+   useradd salsaci
+   chown -R salsaci. ${WORKING_DIR} ${CCACHE_DIR}
+   # Define buildlog filename
+   BUILD_LOGFILE="${WORKING_DIR}/${REVERSE_DEP}.build"
+   # Build package as user salsaci
+   su salsaci -c "eatmydata apt source -b ${REVERSE_DEP}" |& OUTPUT_FILENAME=${BUILD_LOGFILE} filter-output
+   # Restore PWD to ${WORKING_DIR}
+   cd ${WORKING_DIR}
+   rm -rf ${WORKING_DIR}/${REVERSE_DEP}*
+   # Print ccache stats on job log
+   ccache -s
+
+.rdep-build-definition: &rdep-build-definition
+  stage: test
+  image: $SALSA_CI_IMAGES_BASE
+  cache:
+    key: "${REVERSE_DEP}-build"
+    paths:
+      - .ccache
+  except:
+    variables:
+      - $SALSA_CI_ENABLE_REVERSE_DEPENDENCY_BUILD !~ /^(1|yes|true)$/
+      - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
+      - $CI_MERGE_REQUEST_ID != null
+  variables:
+    CCACHE_TMP_DIR: ${CI_PROJECT_DIR}/../.ccache
+    CCACHE_WORK_DIR: ${CI_PROJECT_DIR}/.ccache
+  script:
+    - *rdep-build-before-script
+    - *rdep-build-script
+    - mv ${CCACHE_TMP_DIR} ${CCACHE_WORK_DIR}
+  needs:
+    - job: build
+      artifacts: true
+build-rdep-a2ps:
+  variables:
+    REVERSE_DEP: a2ps
+  extends: .rdep-build-definition
+
+build-rdep-libtwelvemonkeys-java:
+  variables:
+    REVERSE_DEP: libtwelvemonkeys-java
+  extends: .rdep-build-definition


=====================================
debian/salsa-ci.yml
=====================================
@@ -1,3 +1,7 @@
 ---
 include:
   - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml
+  - local: '/debian/rdeps-ci.yml'
+
+variables:
+ SALSA_CI_ENABLE_REVERSE_DEPENDENCY_BUILD: 1
\ No newline at end of file



View it on GitLab: https://salsa.debian.org/java-team/jmagick/-/commit/9ab7aac5793b1fb848c45957bfec14915892ac81

-- 
View it on GitLab: https://salsa.debian.org/java-team/jmagick/-/commit/9ab7aac5793b1fb848c45957bfec14915892ac81
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20240926/27cda2e8/attachment.htm>


More information about the pkg-java-commits mailing list