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

Canary release with a monorepo containing apps and packages #2992

Open
marcus13371337 opened this issue Sep 9, 2021 · 0 comments
Open

Canary release with a monorepo containing apps and packages #2992

marcus13371337 opened this issue Sep 9, 2021 · 0 comments

Comments

@marcus13371337
Copy link

marcus13371337 commented Sep 9, 2021

Hello!

Thanks for this great package, it helped a lot in our transition to a monorepo setup. We currently have packages (which we publish to a repository) and apps (which we deploy manually through various steps).

We are currently pretty satisfied with our setup, but one thing we are not happy with is when we want to manually publish a feature branch to our staging environment.

Approach 1:
My first go-to solution would be to do a canary release! Something like this:

lerna publish prerelease --canary --exact --yes --dist-tag=$BRANCH --preid=$BRANCH

Now I could simply take these new canary versions, bump them in all the affected package.json:s, and use these versions for the rest of the steps in our CI pipeline.

Benefit: The pipeline doesn't push any tags/commits to git
Problem: It seems very complicated to get the canary versions/the packages that were published. Also, it seems as even if I would be able to get the published package maybe through something proposed in this PR, I would still have to manually bump the versions in each package.json file

Approach 2:
The other solution (which we are using today) works like this

lerna version prerelease --yes --dist-tag=$BRANCH --preid=$BRANCH
lerna publish from-git

In every subsequent step in the pipeline:

git pull

Problem: The pipeline pushes a lot of commits/tags to the repo and feature branch, and there are lots of merge-conflicts as a lot of package.json-files will get weird versions (the branch-specific version).

What's your input on our setup and our problems? I know that lerna is not a tool for deployments, but since it's the tool we are using for publishing versions inside our monorepo, we would love to have the support from lerna to provide useful (relevant) commands when deploying our apps which depends on the packages lerna handles.

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

1 participant