Sometimes we need to perform tests that, if gone wrong, may cause the Shared Components to stop working.
Example : when updating lerna to new major version, we wanted to test if publication of packages still worked. While doing this, we pushed some "bad" packages and thus broke the publication, blocking all the teams that were working on Shared Components.
To avoid such situations, all dangerous tests should be performed in an isolated environment.
- Create
shared-components-testfolder. - Copy the contents of
shared-componentsto the newly created folder.
Work inside shared-components-test:
- Create a new package called
package-test. Use the generator to do it. - In
packagesdelete all folders except the newly created package. - In
packages/package-test/package.jsondelete all mentions@shared-components/packages - Remove all mentions of
@shared-componentspackages :rm yarn.lock && yarn rm .git && git init && git add . && git commit -nm "Initial commit"
- On github create
shared-components-testrepo in theshared-componentsorganisation. - Push the contents of
shared-components-testfolder to this repository
Prerequisite : you should be an admin of the shared-components organisation.
On CircleCI:
- Select the
shared-componentsorganisation, thenProjects. - Select the
shared-components-testproject andFollowit. - In the
Checkout SSH keyssection add your key.
On github:
- Configure the CircleCI webhook : in the repository's settings create a new hook that is a copy of that of
shared-componentsrepository. - Fill in the
secretfield with a token generated in your user settings. Give this token all the rights.
Your isolated project is ready! You can test publication of packages without impacting the tags of the production repository. Next step is to create an isolated verdaccio repository. This will be covered later.