Skip to content
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

A question #23

Closed
thealjey opened this issue Sep 28, 2015 · 10 comments
Closed

A question #23

thealjey opened this issue Sep 28, 2015 · 10 comments

Comments

@thealjey
Copy link

@AlexKVal
First of all, sorry if this isn't the right place to ask a question, I just didn't know how else to do it.
I have an existing project on which git tagging was never used (frankly, I'm not very familiar with that), there's a changelog.md file that was maintained by hand.
I want to introduce "release-script" & "mt-changelog" into the project, but I'm afraid I might mess something up (what will happen to my changelog, how can a new changelog be generated if I have no prior git tags, etc.)

Is there an easy to follow, step by step guide on how to integrate "release-script" & "mt-changelog" into a project like that for noobs like me?

Thank you and sorry for bothering.

@AlexKVal
Copy link
Owner

HI 😄 You are not bothering at all.

I would manually git tag your latest manual commit / point you want.
After that commit / point mt-changelog will include all in between - automatically (as it does in R-B project).

Say you have your manual CHANGELOG.md:

v1.0.1 - date - time - note

  • I added this cool feature
  • There was fixed that nasty bug-13
  • Some neat changes were made

and your latest commit is e.g.

6a4f23 v1.0.1 release (that was done manually)

And at this point of time you've decided to use release-script + mt-changelog.
First things first - you should do this:

> git tag v1.0.1

this will mark the "previous" release point for mt-changelog.

All after that tag will be automatically added into CHANGELOG.md.
(only those commits that have specific tags [added] [changed] [fixed])

> npm install -D release-script mt-changelog
> //add / make your changes
> git add && commit them with `[added] [changed] [fixed]` prefixes in commits headers
and when you decide to roll out your next release:
> npm run release patch // or whatever way you've choosen / decided to do it

That's all.

I hope it will help you 🍒

p.s. I would strongly advise you to create kind of "prototype" trash project to check and train your ideas first 😉
I have three trash project exactly for this purpose
https://github.com/AlexKVal/es6-prototype-proj
https://github.com/AlexKVal/es6-prototype-proj-bower
https://github.com/AlexKVal/es6-prototype-proj.github.io

Feel free to ask additional questions here, reactiflux Slack privately or by direct email.

To have an idea how it could look like you can take a look at R-B commits log
https://github.com/react-bootstrap/react-bootstrap/commits/master
and then to its CHANGELOG.md

@thealjey
Copy link
Author

@AlexKVal
it worked! it worked perfectly! didn't screw up anything at all...
Thank you so, so much 😀

@AlexKVal
Copy link
Owner

It is a pleasure to hear that for me.
I'm glad it helped you.
🍒

@thealjey
Copy link
Author

thealjey commented Oct 9, 2015

@AlexKVal
Hi! It's me again 😄
Hope you're doing fine and I'm not wasting too much of your time.

Tried loggin into reactiflux, but couln't because I was not invited into that team on slack.

I want to use the "docsRepo" option, but I have some questions:

  1. can "docsRepo" point to the same repo that the project itself is in?
  2. is the gh-pages branch created and managed by release-script automatically, or do I need to create it myself?
  3. I don't have an "original-project-name.github.io" subdomain, can I use this and have my documentation at "http://.github.io/original-project-name"?

@thealjey thealjey reopened this Oct 9, 2015
@AlexKVal
Copy link
Owner

  1. because of this line src/release.js#L198 you cannot use your project's root folder as docsRoot. Otherwise you would end up with endless folders recursion.

  2. gh-pages branch is not used at all.
    (built) Documents are being published to their own github repository with their own <desired-name-for-documents-site>.github.io domain.

I don't have an "original-project-name.github.io" subdomain

You could create it (https://pages.github.com/).
You just need to name the new repository as <your-desired-name>.github.io and that's all.

E.g. https://github.com/react-bootstrap/react-bootstrap.github.io
See ? the name of the github repo is: react-bootstrap.github.io and that's all.

For such names "http://<author>.github.io/original-project-name" to work - you need to publish docs into gt-pages branch. The release-script doesn't support it.

@thealjey
Copy link
Author

react-bootstrap.github.io is an organization type pages site, it only works like this because "react-bootstrap" also happens to be a user name (i.e. <author> === "react-bootstrap")

the problem is that my user name is very much different than the project name (and I don't plan on registering a new account for this) and there can only be one organization type site per user name

I managed to do it with an NPM "postpublish" hook, don't know if it's the right way to go, but it works 👶

Thank you very much that you find the time to answer my questions, I really appreciate it 😄

@thealjey
Copy link
Author

I really like this project btw, it's super useful, simple, unpretentious, reliable and unopinionated (unlike "semantic-release", which shall remain nameless, lol).
It just gets the job done and is not getting in my way 🏆

@AlexKVal
Copy link
Owner

Thank you for your kind words 😊

@mtscout6
Copy link
Contributor

To avoid the infinite folder recursion issue have you tried setting your tmpDocsRepo to a folder like ../tmp-docs-repo-for-my-project? That would clone the repo to a non-child folder and allow such a release. The only thing I don't think this would handle is the different branching to gh-pages. Though that could easily be added.

Though I don't think the infinite folder recursion would even happen. It just clones the repo to the folder you provide, it doesn't have any recursive logic in it. The only problem is the different branch than master really.

@AlexKVal
Copy link
Owner

The elegant and really working solutions are always simple 👍
But "Simple is hard". (personally I did not hit upon the idea to move out tmp folder to prevent recursion)
Thank you Matt 🍒

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

No branches or pull requests

3 participants