Continuous integration and delivery tips - gregswindle/eslint-plugin-crc GitHub Wiki
The scripts property of a package.json provides many useful commands for automating build, test, and deploy tasks. This repository uses the following scripts to automate test and build tasks.
â All scripts are optional, but recommended. You don't have to use any of these scripts. Omitting one or all will do no harm (but it won't help much, either).
â Task-runners are not required. You can execute these tasks without additional task-running frameworks like
gruntorgulp.
âšī¸ Reference the article
npm-scripts: How npm handles the "scripts" field for more information.
1. Testing with npm-scripts
The npm test command runs these scripts in the following order:
-
pretestruns before any specs are executed -
testexecutes your specs -
posttestexecutes follow-up tasks, e.g.,nsp
2. Versioning with npm-scripts
The npm version command runs these scripts in the following order:
preversionversionpostversion
eslint-plugin-crc uses [semantic-release] and several plugins to automate semver bumps, CHANGELOG updates, GitHub releases, and npm registration:
"@semantic-release/changelog": "1.0.1",
"@semantic-release/git": "3.0.1",
"@semantic-release/npm": "3.0.2",
"semantic-release": "^12.4.1",The npm-script release coordinates:
"release": {
"verifyConditions": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/github"
],
"publish": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/github"
]
}Finally, TravisCI executes semantic-release after any successful merge into master:
jobs:
include:
- stage: release
deploy:
provider: npm
skip_cleanup: true
script:
- npx travis-deploy-once "npx semantic-release"You can use the git tag command to put a permanent marker on a specific commit. Later, you can use the tag to compare the tagged commit to other, future commits in the future. When you push to your remote repository, the tag goes along.
For example, if you have created a tag called v0.1.4 in a Git repository you would remove it from your repository by executing the following two commands:
$ git tag -d v0.1.4
$ git push origin :refs/tags/v0.1.4First, create NEW as an alias of OLD:
$ tag NEW OLD
Then, delete OLD:
$ tag -d OLD
"How do you rename a git tag?"
When you're finished with a branch -- i.e., there has been a merged pull request -- you should delete your working branch.
In most cases, the first clone or fork of a git repos creates a remote with the alias origin. Sometimes our Verizon colleagues won't have access to GitHub.com, however. In those cases, we can create another remote and point it to Verizon's internal Bitbucket repositories.
â Standard naming conventions for Verizon remotes If
originisn't pointing at an internal Verizon repos, keep it simple, and usevzas your alternate remote alias. BTW, there is no standard naming convention for this scenario, yet. đ
$ git remote add vz <remote-uri>
# Verify the new remote
$ git remote -v
If you want to change origin's repository:
$ git remote set-url origin <new-url>
$ git branch -d <branch_name>
$ git push origin --delete <branch_name>
4. Delivery with npm-scripts
Once all features are done, done, and done for MVP 1, I'll bump the project to semantic version 1.0.0 and publish the project on the public npm registery.
đŦ nodejs/Release. (2018). GitHub. Retrieved 20 February 2018, from https://github.com/nodejs/Release/blob/master/README.md
| Release | Status | Codename | Initial Release | Active LTS Start | Maintenance LTS Start | End-of-life |
|---|---|---|---|---|---|---|
| v0.10.x | End-of-Life | - | 2013-03-11 | - | 2015-10-01 | 2016-10-31 |
| v0.12.x | End-of-Life | - | 2015-02-06 | - | 2016-04-01 | 2016-12-31 |
| [4.x][] | Maintenance LTS | [Argon][] | 2015-09-08 | 2015-10-01 | 2017-04-01 | 2018-04-30 |
| 5.x | End-of-Life | 2015-10-29 | 2016-06-30 | |||
| [6.x][] | Active LTS | [Boron][] | 2016-04-26 | 2016-10-18 | 2018-04-30 | April 2019 |
| 7.x | End-of-Life | 2016-10-25 | 2017-06-30 | |||
| [8.x][] | Active LTS | [Carbon][] | 2017-05-30 | 2017-10-31 | April 2019 | December 20191 |
| 9.x | Current Release | 2017-10-01 | June 2018 | |||
| 10.x | Pending | Pending | Apr 2018 | October 2018 | April 2020 | April 2021 |
Dates are subject to change.
- 1: The 8.x Maintenance LTS cycle is currently scheduled to expire early on December 31, 2019 to align with the scheduled End-of-Life of OpenSSL-1.0.2.
âšī¸ The wiki page Semantic versioning explains how this project versions its product.
