Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Best practices for deploying to production #338

Open
jfitzsimmons2 opened this issue May 10, 2019 · 2 comments
Open

Best practices for deploying to production #338

jfitzsimmons2 opened this issue May 10, 2019 · 2 comments

Comments

@jfitzsimmons2
Copy link

emulsify version (see releases): 3.1

node version: 8.11.3

npm (or yarn) version: 6.5

What you did: Deployed to Acquia Cloud using BLT

What happened: Pattern Lab was not deployed along with the rest of the codebase

Problem description: I'm unsure of "best practices" for deploying PL within Emulsify to production. By default pattern-lab/ is in .gitignore and then within the pattern-lab folder, public/ is also ignored. To make it able to be deployed to a server, is it as simple as removing those from .gitignore or are there other considerations I need to keep in mind? Is there any documentation on this topic?

@jfitzsimmons2
Copy link
Author

I've done some tinkering and found some information that might be worth sharing here in case anyone else stumbles upon this.

  1. Emulsify comes with a GitHub pages command gulp ghpages-deploy although I can't find anywhere what other steps are required in order to make this work.

  2. Through messing with Step 1 I found that running gulp build will create a build folder within the theme that is ready to go onto a server. This is the route I'm going to be going with, running gulp build and then creating another task to rsync to a server at work seems like it'll do just fine, and I won't have to figure out how to get it on Acquia Cloud.

I'm curious what others do so feel free to chime in if you've gone another route.

Would there be any interest in me contributing this information into the Wiki or docs?

@ndeet
Copy link

ndeet commented Jun 19, 2019

Hi @jfitzsimmons2,

glad I found this issue. I'm currently fighting with this as well but on platform.sh. Goal is to deploy a fully working styleguide alongside with the site.

The problem I see with both, whitelisting the pattern-lab + and with gulp build && gulp createBuild approach is that the sources are still absolute paths and fail to load (Javascript not working) unless you map that public directory to the document root and make it available on a separate subdomain.
e.g.

Failed to load resource: net::ERR_FILE_NOT_FOUND
/dist/02-molecules/menus/main-menu/main-menu.js:1

Btw. the official gulp ghpages-deploy also faces these issue if you look into console:
https://fourkitchens.github.io/emulsify/pattern-lab/public/?p=pages-article

I have not much experience with pattern-lab but I think the pattern-lab way is to use php core/console --export command for this (it should correctly reference the assets relative instead of absolute). Which I would then commit and make available - but unfortunately this is also broken (throws exception) when using with emulsify.

Would really appreciate if someone with deeper knowledge could give php core/console --export a try and give hints how to fix the errors (currently I don't see the woods for the tree) so a build artifact can be deployed alongside the site.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants