codeforeauclaire / foodtrucks

3 stars 6 forks source link

[Consumer] Debug `deploy-to-gh-pages` #77

Open AnthonyAstige opened 8 years ago

AnthonyAstige commented 8 years ago

Per PM with Levi & Anthony (Levi ran into issue running script), to do at a meeting in person.

Not urgent for MVP as I can push changes. However it would be nice to have a backup person to push and to give Levi control here as he's handling most of the front end coding.

AnthonyAstige commented 8 years ago

Related slack conversation

Levi's message Jun 30th

I think I found a better git workflow for managing gh-pages. for reference see

git checkout master rm -rf consumer-ui git subtree add --prefix=consumer-ui https://github.com/codeforeauclaire/foodtrucks.git gh-pages --squash git subtree pull --prefix=consumer-ui https://github.com/codeforeauclaire/foodtrucks.git gh-pages

make changes and commit on master git push origin master git subtree push --prefix=consumer-ui https://github.com/codeforeauclaire/foodtrucks.git gh-pages

I haven’t pushed to the remote yet. Hesitant as I’m not sure I would be able to fix whatever breaks. What do you think?

Anthony's response Jun 30th

I haven't used subtrees. My gut feeling peaking at the links above and googling a little, is that subtrees would likely be a superior workflow for production-managers at the cost of complexity for every developer. I'd like to avoid that complexity if possible. That said the deploy-to-gh-pages script could use some attention so I've put related issues in what I'll call our next target milestone v0.2 @ https://github.com/codeforeauclaire/foodtrucks/milestones/v0.2

Levi July 1st

I disagree. Too me, this seems less complex. I made a repo to try out this flow.

git clone https://github.com/levifelling/ghp-test.git
... mod & commit ....
git push origin master
git subtree push --prefix=public https://github.com/levifelling/ghp-test.git gh-pages
 GitHub
levifelling/ghp-test
ghp-test - test gh-pages git workflow 

view resulting gh-pages at https://levifelling.github.io/ghp-test/

so only new command needed is `git subtree push --prefix=public https://github.com/levifelling/ghp-test.git gh-pages` which if we wanted to could be put in a deploy script, or just referenced in the readme

Anthony July 1st

If we use subtrees, can someone commit to the consumer-ui folder in the master branch without ever knowing of or typing subtree?

Levi July 1st

yes

the subtree is created once, and then it just comes along with the cloned repo

so looks jsut like it is the ~/consumer-ui dir

Anthony July 1st

And we would get a different commit history in each folder, right?

Levi July 1st

checkout https://github.com/levifelling/ghp-test GitHub levifelling/ghp-test ghp-test - test gh-pages git workflow

in that repo public is a subtree from gh-pages branch

Anthony July 1st

I made a test repo following the instructions from yours, and I agree now the workflow feels nice / I think would make for a simpler less brittle deploy script. Even though it works when briefly tested, I'm still foggy on what git subtrees exactly are - I'm reading up on https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt & https://developer.atlassian.com/blog/2015/05/the-power-of-git-subtree/. There may be some issues with rebasing - https://stackoverflow.com/questions/12858199/how-to-rebase-after-git-subtree-add, though I'm not sure how it'll effect us (Lowell uses rebasing I think, I don't do it much). If we want to go at using subtrees for the foodtrucks project as a learning experience it sounds good to me; feel free to drive it forward if you like and I'll note it for myself later as well.