Skip to content

Commit

Permalink
fix(app-backend): restore external config... (#1262)
Browse files Browse the repository at this point in the history
* fix(app-backend): restore external config schema support #24779 - patch for 1.26.x

Signed-off-by: Nick Boldt <nboldt@redhat.com>

copy patches into yarn context so they're applied when doing yarn install; also include patch files in final container for reference and easy access

Signed-off-by: Nick Boldt <nboldt@redhat.com>

* adjust readme in the patch; move deps to devdeps

Signed-off-by: Nick Boldt <nboldt@redhat.com>

* pin deps

Signed-off-by: Nick Boldt <nboldt@redhat.com>

* regen lock

Signed-off-by: Nick Boldt <nboldt@redhat.com>

* since we need to run yarn --production, move these deps back to prod (not dev)

Signed-off-by: Nick Boldt <nboldt@redhat.com>

---------

Signed-off-by: Nick Boldt <nboldt@redhat.com>
  • Loading branch information
nickboldt committed May 15, 2024
1 parent 70deb37 commit 1c88c8a
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .rhdh/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ RUN chmod +x $YARN
# Stage 2 - Install dependencies
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/ ./dynamic-plugins/
COPY $EXTERNAL_SOURCE_NESTED/package.json $EXTERNAL_SOURCE_NESTED/yarn.lock ./
COPY $EXTERNAL_SOURCE_NESTED/patches/ ./patches/
COPY $EXTERNAL_SOURCE_NESTED/packages/app/package.json ./packages/app/package.json
COPY $EXTERNAL_SOURCE_NESTED/packages/backend/package.json ./packages/backend/package.json
COPY $EXTERNAL_SOURCE_NESTED/plugins/scalprum-backend/package.json ./plugins/scalprum-backend/package.json
Expand Down Expand Up @@ -214,6 +215,9 @@ COPY --from=build --chown=1001:1001 $REMOTE_SOURCES_DIR/ ./
# Downstream only - copy embedded dynamic plugins from $REMOTE_SOURCES_DIR
COPY --from=build $REMOTE_SOURCES_DIR/dynamic-plugins/dist/ ./dynamic-plugins/dist/

# include patch files in final container just for reference
COPY $EXTERNAL_SOURCE_NESTED/patches/ ./patches/

# Copy script to gather dynamic plugins; copy embedded dynamic plugins to root folder; fix permissions
COPY docker/install-dynamic-plugins.py docker/install-dynamic-plugins.sh ./
RUN chmod -R a+r ./dynamic-plugins/ ./install-dynamic-plugins.py; \
Expand Down
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RUN chmod +x $YARN
FROM skeleton AS deps
COPY $EXTERNAL_SOURCE_NESTED/dynamic-plugins/ ./dynamic-plugins/
COPY $EXTERNAL_SOURCE_NESTED/package.json $EXTERNAL_SOURCE_NESTED/yarn.lock ./
COPY $EXTERNAL_SOURCE_NESTED/patches/ ./patches/
COPY $EXTERNAL_SOURCE_NESTED/packages/app/package.json ./packages/app/package.json
COPY $EXTERNAL_SOURCE_NESTED/packages/backend/package.json ./packages/backend/package.json
COPY $EXTERNAL_SOURCE_NESTED/plugins/scalprum-backend/package.json ./plugins/scalprum-backend/package.json
Expand Down Expand Up @@ -120,6 +121,9 @@ COPY --from=cleanup --chown=1001:1001 $CONTAINER_SOURCE/ ./
# Upstream only - copy embedded dynamic plugins from $CONTAINER_SOURCE
COPY --from=build $CONTAINER_SOURCE/dynamic-plugins/dist/ ./dynamic-plugins/dist/

# include patch files in final container just for reference
COPY $EXTERNAL_SOURCE_NESTED/patches/ ./patches/

# Copy script to gather dynamic plugins; copy embedded dynamic plugins to root folder; fix permissions
COPY docker/install-dynamic-plugins.py docker/install-dynamic-plugins.sh ./
RUN chmod -R a+r ./dynamic-plugins/ ./install-dynamic-plugins.py; \
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
},
"scripts": {
"prepare": "husky install",
"postinstall": "patch-package",
"ci": "turbo run lint build test",
"start": "turbo run start --parallel",
"start-backend": "turbo run start --filter=backend",
Expand Down Expand Up @@ -37,7 +38,9 @@
]
},
"dependencies": {
"node-gyp": "9.4.1"
"node-gyp": "9.4.1",
"patch-package": "8.0.0",
"postinstall-postinstall": "2.1.0"
},
"devDependencies": {
"@backstage/cli": "0.26.4",
Expand Down
48 changes: 48 additions & 0 deletions patches/@backstage+plugin-app-backend+0.3.65.patch

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21979,9 +21979,9 @@ passport@^0.6.0:
pause "0.0.1"
utils-merge "^1.0.1"

patch-package@^8.0.0:
patch-package@8.0.0, patch-package@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-8.0.0.tgz#d191e2f1b6e06a4624a0116bcb88edd6714ede61"
resolved "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz#d191e2f1b6e06a4624a0116bcb88edd6714ede61"
integrity sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA==
dependencies:
"@yarnpkg/lockfile" "^1.1.0"
Expand Down Expand Up @@ -22591,6 +22591,11 @@ postgres-interval@^1.1.0:
dependencies:
xtend "^4.0.0"

postinstall-postinstall@2.1.0:
version "2.1.0"
resolved "https://registry.npmjs.org/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3"
integrity sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ==

prebuild-install@^7.1.1:
version "7.1.2"
resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.1.2.tgz#a5fd9986f5a6251fbc47e1e5c65de71e68c0a056"
Expand Down

0 comments on commit 1c88c8a

Please sign in to comment.