szepeviktor / composer-managed-wordpress

Install and manage WordPress with Composer 👨‍🚀
https://github.com/szepeviktor/wordpress-website-lifecycle
MIT License
25 stars 3 forks source link

question: why gitignore `composer.lock`? #28

Closed montchr closed 6 months ago

montchr commented 6 months ago

I noticed that you have /composer.lock in .gitignore. Could you help me understand your reasoning and some idea of your workflow re: composer.lock? Does that file not sit around as "state" that might differ across environments?

szepeviktor commented 6 months ago

Hello Chris! 👋🏻 Thank you for your question.

My repositories are not "download&use" but "learn&understand". Ignoring the lock file allows me to issue composer update in this template repo without introducing file changes.

image

In production you could go

  1. lazy: always update all plugins - not committing the lock file
  2. strict: have a lock file in the repo
szepeviktor commented 6 months ago

a sneak peek into the README

image

szepeviktor commented 6 months ago

lines from the deploy script

https://github.com/szepeviktor/composer-managed-wordpress/blob/9747a8bbdde5cc727504b2cba670b36525af7901/deploy-receiver.sh#L164-L166

montchr commented 6 months ago

Gotcha, makes sense. Thanks for the clarification!

szepeviktor commented 6 months ago

Glad to talk to you.