Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]: CI - Pass full backstopjs package name/version to Docker #84

Open
6 tasks
dgrebb opened this issue Dec 24, 2023 · 1 comment
Open
6 tasks

[FEAT]: CI - Pass full backstopjs package name/version to Docker #84

dgrebb opened this issue Dec 24, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@dgrebb
Copy link
Owner

dgrebb commented Dec 24, 2023

Summary

Let's allow the backstopjs package installation to be passable in args during Docker build.

Why?

This will allow GitHub actions to pass the current backstopjs branch to Docker, so build, publish, and tests are run with the latest changes this branch has introduced.

How?

  • rename the Dockerfile ARG "BACKSTOPJS_VERSION" → "BACKSTOP_INSTALL_SOURCE"
  • adjust the ENV BACKSTOPJS_VERSION=$BACKSTOPJS_VERSIONBACKSTOP_INSTALL_SOURCE=$BACKSTOP_INSTALL_SOURCE
  • adjust npm scripts as needed
  • create GitHub Actions var BACKSTOP_INSTALL_SOURCE to concatenate installation source path
  • update GitHub Actions to pass the BACKSTOP_INSTALL_SOURCE to Docker builds
  • check if any $TAGs need to be adjusted
@dgrebb dgrebb added this to the GitHub Actions and CI/CD milestone Dec 24, 2023
@dgrebb dgrebb added the enhancement New feature or request label Dec 24, 2023
@dgrebb dgrebb self-assigned this Dec 24, 2023
@dgrebb
Copy link
Owner Author

dgrebb commented Dec 24, 2023

@garris FYA — another improvement for your consideration. This would include any changes to backstopjs within Docker as part of the overall regression suite.

Currently one must commit a change to Dockerfile to include a GitHub branch path to test changes within npm backstop itself:

diff --git a/docker/Dockerfile b/docker/Dockerfile
index 18c3691..9460944 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -26,7 +26,7 @@ RUN apt-get -qq update >/dev/null && apt-get install -qq \
 ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
 # playwright shared browser path (does install a 2nd chromium - can't be skipped)
 ENV PLAYWRIGHT_BROWSERS_PATH=/opt/pw-browsers
-RUN mkdir ${PLAYWRIGHT_BROWSERS_PATH} && npm install -g --unsafe-perm=true --allow-root backstopjs@${BACKSTOPJS_VERSION} && npx --yes --verbose --foreground-scripts playwright install --with-deps
+RUN mkdir ${PLAYWRIGHT_BROWSERS_PATH} && npm install -g --unsafe-perm=true --allow-root dgrebb/backstopjs#downstream/feature-1525-headless-mode-deprecation && npx --yes --verbose --foreground-scripts playwright install --with-deps

Super hard to explain. This feature is a good candidate for first-hand review when it's ready.

@dgrebb dgrebb removed their assignment Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant