From 4aa2901fd98f0b7fdcfa841f30a7b22d5800590b Mon Sep 17 00:00:00 2001 From: alexanderM91 Date: Fri, 12 Jul 2024 20:35:24 +0200 Subject: [PATCH 1/2] NPM_TOKEN --- bin/sdk/assets/baked.sh | 1 + images/baked/assets/Dockerfile | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/bin/sdk/assets/baked.sh b/bin/sdk/assets/baked.sh index 7005ef6a4..e8a755d1c 100755 --- a/bin/sdk/assets/baked.sh +++ b/bin/sdk/assets/baked.sh @@ -101,6 +101,7 @@ function Assets::build() { --build-arg "SPRYKER_PIPELINE=${SPRYKER_PIPELINE}" \ --build-arg "SPRYKER_BUILD_HASH=${SPRYKER_BUILD_HASH:-"current"}" \ --build-arg "SPRYKER_BUILD_STAMP=${SPRYKER_BUILD_STAMP:-""}" \ + --build-arg "SPRYKER_NPM_TOKEN=${SPRYKER_NPM_TOKEN:-"AAA"}" \ . 1>&2 Console::end "[DONE]" diff --git a/images/baked/assets/Dockerfile b/images/baked/assets/Dockerfile index 5e990fe16..2ea0d5cc9 100644 --- a/images/baked/assets/Dockerfile +++ b/images/baked/assets/Dockerfile @@ -9,6 +9,14 @@ COPY --chown=spryker:spryker package.json package-lock.json ${srcRoot}/ COPY --chown=spryker:spryker frontend* ${srcRoot}/frontend COPY --chown=spryker:spryker tsconfig*.json ${srcRoot}/ COPY --chown=spryker:spryker config/Yves ${srcRoot}/config/Yves +COPY --chown=spryker:spryker .npmrc ${srcRoot}/ + +ARG SPRYKER_NPM_TOKEN +ENV SPRYKER_NPM_TOKEN=${SPRYKER_NPM_TOKEN} + +RUN if [ -n "$SPRYKER_NPM_TOKEN" ]; then \ + sed -i "s|\${SPRYKER_NPM_TOKEN}|${SPRYKER_NPM_TOKEN}|" .npmrc; \ + fi ARG SPRYKER_ASSETS_MODE='development' ENV SPRYKER_ASSETS_MODE=${SPRYKER_ASSETS_MODE} From 0601d61971a3e748019ec46420219827ddf70323 Mon Sep 17 00:00:00 2001 From: alexanderM91 Date: Mon, 29 Jul 2024 18:44:21 +0200 Subject: [PATCH 2/2] A check for dev mode --- bin/sdk/assets/baked.sh | 2 +- bin/sdk/images/common.sh | 1 + images/mount/cli/Dockerfile | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/sdk/assets/baked.sh b/bin/sdk/assets/baked.sh index e8a755d1c..e7cefe137 100755 --- a/bin/sdk/assets/baked.sh +++ b/bin/sdk/assets/baked.sh @@ -101,7 +101,7 @@ function Assets::build() { --build-arg "SPRYKER_PIPELINE=${SPRYKER_PIPELINE}" \ --build-arg "SPRYKER_BUILD_HASH=${SPRYKER_BUILD_HASH:-"current"}" \ --build-arg "SPRYKER_BUILD_STAMP=${SPRYKER_BUILD_STAMP:-""}" \ - --build-arg "SPRYKER_NPM_TOKEN=${SPRYKER_NPM_TOKEN:-"AAA"}" \ + --build-arg "SPRYKER_NPM_TOKEN=${SPRYKER_NPM_TOKEN:-""}" \ . 1>&2 Console::end "[DONE]" diff --git a/bin/sdk/images/common.sh b/bin/sdk/images/common.sh index 9098b4682..411d0a184 100644 --- a/bin/sdk/images/common.sh +++ b/bin/sdk/images/common.sh @@ -126,6 +126,7 @@ function Images::_buildApp() { --build-arg "SPRYKER_PIPELINE=${SPRYKER_PIPELINE}" \ --build-arg "SPRYKER_BUILD_HASH=${SPRYKER_BUILD_HASH:-"current"}" \ --build-arg "SPRYKER_BUILD_STAMP=${SPRYKER_BUILD_STAMP:-""}" \ + --build-arg "SPRYKER_NPM_TOKEN=${SPRYKER_NPM_TOKEN:-""}" \ . 1>&2 if [ -n "${SPRYKER_XDEBUG_MODE_ENABLE}" ]; then diff --git a/images/mount/cli/Dockerfile b/images/mount/cli/Dockerfile index e6c0d8589..bf734b969 100644 --- a/images/mount/cli/Dockerfile +++ b/images/mount/cli/Dockerfile @@ -5,3 +5,6 @@ FROM ${SPRYKER_PARENT_IMAGE} as cli-development ENV DEVELOPMENT_CONSOLE_COMMANDS=1 +ARG SPRYKER_NPM_TOKEN +ENV SPRYKER_NPM_TOKEN=${SPRYKER_NPM_TOKEN} +