-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79b42a1
commit 24431bc
Showing
12 changed files
with
177 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Continuous Deployment | ||
|
||
Having CD configured in an automated way, allows us to: | ||
|
||
- make the release task less time-consuming and less prone to human errors | ||
- decrease the attack surface by not needing maintainers to have publish access | ||
|
||
## Setup | ||
|
||
### Travis CI | ||
|
||
The configuration file is located at `.travis.yml`. | ||
|
||
Requirements: this configuration assumes a `NPM_TOKEN` environment variable defined in Travis's | ||
settings. (see [travis docs about env vars][travis-docs-env-vars]) | ||
|
||
Notes: | ||
|
||
- `before_deploy` | ||
|
||
This hook runs after the build and testing steps have finished, and is purpose is twofold: | ||
|
||
1. Clean-up uncommitted changes resulted from installing or building, e.g.: lockfiles | ||
2. Grant the `npm` agent publish access | ||
|
||
- `deploy` | ||
|
||
The deploy step uses lerna to publish packages that have been released, but not deployed on `npm`: | ||
|
||
```json | ||
"publish:nightly": "lerna publish from-package --dist-tag nightly --yes" | ||
``` | ||
|
||
The `skip_cleanup` flag tells Travis not to delete files not tracked by git, | ||
such as the build directory of the packages: `dist`. | ||
|
||
This step runs only on the v11 of `Node` whenever there are new tags. | ||
(see [`Releasing.md`](/docs-internal/Releasing.md)) | ||
|
||
## Useful readings | ||
|
||
- [lerna publish docs](https://github.com/lerna/lerna/tree/master/commands/publish) | ||
(in particular the `from-package` positional and the `--dist-tag` and `--yes` flags) | ||
- [lerna + travis setup demo](https://github.com/geut/lerna-travis-demo) | ||
- [travis deployment docs](https://docs.travis-ci.com/user/deployment/) | ||
|
||
[travis-docs-env-vars]: https://docs.travis-ci.com/user/environment-variables/#defining-variables-in-repository-settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Releasing | ||
|
||
Terminology for this context: | ||
|
||
- Releasing: marking (tagging) a new software version | ||
- Publishing: uploading a new build to the package manager | ||
- Deploying: same as publishing | ||
|
||
The act of making a new release is a manual step, as we need to assess whether we should bump a new | ||
major, minor or patch. (see [semver docs](https://semver.org/)) | ||
|
||
## Preparing | ||
|
||
Before releasing let's make sure we are including the latest changes by updating the local branch: | ||
|
||
1. `git checkout master` | ||
2. `git pull` | ||
3. `git checkout release/v6.0.0` (the next tag of the `@aragon/cli` package) | ||
|
||
Prepare the release notes: | ||
|
||
1. Draft a new release on GitHub: <https://github.com/aragon/aragon-cli/releases> | ||
2. Summarize the changes since the last release: <https://github.com/aragon/aragon-cli/commits/master> | ||
|
||
## Release all packages that have been updated | ||
|
||
1. Run `npm run version` and bump the versions according to the release summary. | ||
2. On GitHub Releases, choose the project-wide tag (`@aragon/cli`'s version) and publish. | ||
3. Wait for the CD agent to finish the automatic deployment. (see [`Continuous-deployment.md`](/docs-internal/Continuous-deployment.md)) | ||
4. Make some noise on the `#dev` channel. | ||
|
||
## Distribution tags | ||
|
||
The tags we use are: `latest`, `stable`, `nightly`. | ||
|
||
> By default, `npm install <pkg>` (without any `@<version>` or `@<tag>` specifier) installs the `latest` tag. | ||
> | ||
> By default, other than `latest`, no tag has any special significance to `npm` itself. | ||
To mark a `nightly` build as latest stable: | ||
|
||
```sh | ||
npm dist-tag add @aragon/[email protected] stable | ||
npm dist-tag add @aragon/[email protected] latest | ||
``` | ||
|
||
## Something went wrong | ||
|
||
- Revert the last commit: | ||
|
||
```sh | ||
git revert HEAD~ --hard | ||
git push --force | ||
``` | ||
|
||
- Delete the tags, locally and on the remote, i.e.: | ||
|
||
```sh | ||
git tag --delete @aragon/[email protected] [email protected] | ||
git push --delete origin @aragon/[email protected] [email protected] | ||
``` | ||
|
||
Note: you cannot redeploy the same version to npm, a new version must be used. | ||
(see [npm unpublish docs](https://docs.npmjs.com/cli/unpublish)) | ||
|
||
## Useful readings | ||
|
||
- [npm dist tag docs](https://docs.npmjs.com/cli/dist-tag) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters