atlassian / lerna-semantic-release

📦:🛠✨💥 – fully automated package publishing
https://www.npmjs.com/package/lerna-semantic-release
679 stars 42 forks source link

Question: Why delete the travis repo clone? #72

Closed jan-molak closed 7 years ago

jan-molak commented 7 years ago

I noticed that in your before_install.sh you're deleting the local git repository (cloned by travis) and then clone it yourself again.

Could you please advise why this is required?

Thanks, Jan

jan-molak commented 7 years ago

Answered it myself; My understanding was that Travis sets the branch before the before_install, but it looks like it doesn't.

fatal: could not set upstream of HEAD to origin/master when it does not point to any branch.
The command "scripts/travis/before_install.sh" failed and exited with 128 during .
elmariofredo commented 7 years ago

Main question is why do you need to have branch in before install step? I see lot of steps in before_install.sh without any explanation why they are needed.

jpnelson commented 7 years ago

As you say, there are many steps there related to cleaning and re-setting up the git repo. One of the issues has been that the whole history isn't guaranteed to be there – IIRC this helped to mitigate that.

elmariofredo commented 7 years ago

Thanks good to know! Would be nice to have it noted there so others understands reasoning behind ugly rm -rf .git.

Also this git fetch --unshallow --tags might solve the issue as described here http://stackoverflow.com/a/39467986