From e839a6e0b9236a85085193c82096c316eecdd047 Mon Sep 17 00:00:00 2001 From: Lars Francke Date: Thu, 24 Jul 2025 11:17:45 +0200 Subject: [PATCH] Use our build-repo to cache NPM dependencies --- CHANGELOG.md | 6 ++++++ kafka/Dockerfile | 1 + stackable-devel/Dockerfile | 13 +++++++++++++ stackable-devel/stackable/.npmrc | 1 + stackable-devel/stackable/.yarnrc | 1 + stackable-devel/stackable/.yarnrc.yml | 1 + 6 files changed, 23 insertions(+) create mode 100644 stackable-devel/stackable/.npmrc create mode 100644 stackable-devel/stackable/.yarnrc create mode 100644 stackable-devel/stackable/.yarnrc.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index e9a889f9c..a62f1889f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Changed + +- all: Use our build-repo to cache NPM dependencies ([#1219]) + +[#1219]: https://github.com/stackabletech/docker-images/pull/1219 + ## [25.7.0] - 2025-07-23 ## [25.7.0-rc1] - 2025-07-18 diff --git a/kafka/Dockerfile b/kafka/Dockerfile index 52050b973..e01f09fda 100644 --- a/kafka/Dockerfile +++ b/kafka/Dockerfile @@ -31,6 +31,7 @@ find . -type f -print0 | xargs -0 sed -i "s/\-stackable0\.0\.0\-dev/-stackable${ tar -czf /stackable/kafka-${NEW_VERSION}-src.tar.gz . # TODO: Try to install gradle via package manager (if possible) instead of fetching it from the internet +# We patch Kafka to use our Nexus build repo instead # We don't specify "-x test" to skip the tests, as we might bump some Kafka internal dependencies in the future and # it's a good idea to run the tests in this case. ./gradlew clean releaseTarGz diff --git a/stackable-devel/Dockerfile b/stackable-devel/Dockerfile index f7f324b81..4606819e3 100644 --- a/stackable-devel/Dockerfile +++ b/stackable-devel/Dockerfile @@ -115,3 +115,16 @@ microdnf clean all chown ${STACKABLE_USER_UID}:0 /stackable/patchable rm -rf /patchable EOF + +# Make sure NPM and YARN use our build mirror +# In theory YARN should (I believe) fall back to the npmrc file but we want to make sure... +COPY --chown=${STACKABLE_USER_UID}:0 stackable-devel/stackable/.npmrc /stackable/.npmrc +COPY --chown=${STACKABLE_USER_UID}:0 stackable-devel/stackable/.npmrc /root/.npmrc + +# YARN v1 +COPY --chown=${STACKABLE_USER_UID}:0 stackable-devel/stackable/.yarnrc /stackable/.yarnrc +COPY --chown=${STACKABLE_USER_UID}:0 stackable-devel/stackable/.yarnrc /root/.yarnrc + +# YARN v2++ +COPY --chown=${STACKABLE_USER_UID}:0 stackable-devel/stackable/.yarnrc.yml /stackable/.yarnrc.yml +COPY --chown=${STACKABLE_USER_UID}:0 stackable-devel/stackable/.yarnrc.yml /root/.yarnrc.yml diff --git a/stackable-devel/stackable/.npmrc b/stackable-devel/stackable/.npmrc new file mode 100644 index 000000000..5d607451c --- /dev/null +++ b/stackable-devel/stackable/.npmrc @@ -0,0 +1 @@ +registry=https://build-repo.stackable.tech/repository/npm-public/ diff --git a/stackable-devel/stackable/.yarnrc b/stackable-devel/stackable/.yarnrc new file mode 100644 index 000000000..b3f3afad1 --- /dev/null +++ b/stackable-devel/stackable/.yarnrc @@ -0,0 +1 @@ +registry "https://build-repo.stackable.tech/repository/npm-public/" diff --git a/stackable-devel/stackable/.yarnrc.yml b/stackable-devel/stackable/.yarnrc.yml new file mode 100644 index 000000000..d10612872 --- /dev/null +++ b/stackable-devel/stackable/.yarnrc.yml @@ -0,0 +1 @@ +npmRegistryServer: "https://build-repo.stackable.tech/repository/npm-public/"