-
Notifications
You must be signed in to change notification settings - Fork 79
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
Set-up Continuous Deployment #513
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3cd302b
Set-up CD
kernelwhisperer d25666d
Allow release branches
kernelwhisperer 2988731
Change deploy provider to script
kernelwhisperer 28e6abd
Fix travis deploy script
kernelwhisperer 41500dd
Add skip_cleanup to travis
kernelwhisperer 45271d1
Fix travis.yml
kernelwhisperer b796f76
Fix publish script
kernelwhisperer c9fe7ea
Fix create-aragon-app version
kernelwhisperer 6502b4c
Publish
kernelwhisperer 25824a1
Update docs and publish script
kernelwhisperer e3fe61f
Merge branch 'master' into release/v5.9.5
kernelwhisperer a2af16c
Update snapshots
kernelwhisperer b162da2
Update e2e snapshots
kernelwhisperer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically the
git stash
probably isn't necessary, since npm uses the.gitignore
by default and it's unlikely travis will have changed any commits that could be tracked.