Skip to content

Fix deployment done if FOLDER is part of the files under source control #40

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

Closed

Conversation

MLKiiwy
Copy link

@MLKiiwy MLKiiwy commented Oct 16, 2019

Description

If the specified FOLDER is part of the files under git source control, the script is not able to add them, resulting of an empty commit ... and failing to deploy.

Here we create a new worktree from the folder we want to deploy.
We add everything missing in this folder and we push.

It's related to #36

I also change the initialization of the gh-pages branch with only git command.

Testing Instructions

I have tested it with repo.
It's working fine, it's also adding a small feature now the gh-pages branch is also versionned with all deployed versions.

Issue with new worktree initialisation

But I'm not super happy by the fact that I have to recreate a branch after switching to the new worktree ...
On local when I create a worktree from a branch, if I go into this new worktree I'm already on the branch if it exists.
Here after few tests it's not really the case, I'm in a detached state (+ I have to specified the remote to worktree add command).
Maybe I'm missing something

@MLKiiwy MLKiiwy force-pushed the fix-folder-part-of-versionned branch 6 times, most recently from e9c3e52 to 96fcdc8 Compare October 16, 2019 14:14
@JamesIves
Copy link
Owner

I'll give this a test later today, thanks for the PR!

@JamesIves JamesIves added this to the Version 3 milestone Oct 16, 2019
@JamesIves JamesIves self-requested a review October 16, 2019 14:31
@MLKiiwy MLKiiwy force-pushed the fix-folder-part-of-versionned branch 14 times, most recently from e29f71c to bfa4043 Compare October 16, 2019 15:46
@MLKiiwy MLKiiwy force-pushed the fix-folder-part-of-versionned branch from bfa4043 to 46435ee Compare October 16, 2019 15:51
@MLKiiwy
Copy link
Author

MLKiiwy commented Oct 16, 2019

I have tested it and update the description of my PR.

Copy link
Owner

@JamesIves JamesIves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and my initial round of testing went well. Just the single question.

echo "Deploying to GitHub..."
git fetch origin
echo "Prepare"
rm -rf folder_for_deployment
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to delete the deployment folder once you fetch from the origin? Presumably it doesn't exist yet right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep it's not required your right

@JamesIves
Copy link
Owner

Superseded by #44 - Thanks so much for the PR and insight!

@JamesIves JamesIves closed this Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants