Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dollarshaveclub/harmless-changes
Ignore unnecessary build steps if changes are harmless to make builds faster ๐ ๐จ
https://github.com/dollarshaveclub/harmless-changes
ci circleci continuous-delivery continuous-integration test-automation testing-tools travis-ci
Last synced: about 2 months ago
JSON representation
Ignore unnecessary build steps if changes are harmless to make builds faster ๐ ๐จ
- Host: GitHub
- URL: https://github.com/dollarshaveclub/harmless-changes
- Owner: dollarshaveclub
- License: mit
- Created: 2018-02-06T01:36:53.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-02T23:38:12.000Z (almost 5 years ago)
- Last Synced: 2024-10-07T08:13:02.039Z (3 months ago)
- Topics: ci, circleci, continuous-delivery, continuous-integration, test-automation, testing-tools, travis-ci
- Language: Shell
- Homepage:
- Size: 62.5 KB
- Stars: 7
- Watchers: 6
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Harmless Changes
Harmless changes is a simple bash script that helps ignore unneeded build steps if code changes are harmless. This utility can speed up CI build times! ๐ ๐จ
โ ๏ธ **NOTE:** This code is currently untested. Tests are in progress!
---
Summaryย ย
Installย ย
Useย ย
Contributingย ย
Thanks---
## Summary
CI build steps can test many things, but what if the Pull Request to a `master` branch contains only for changes to a repository's README or a slight change to an image? Harmless Changes checks if the **only** changes that were made within a Pull Request were for items that can be ignored in CI via a `.ciingore` file. CI build steps can be exited if the Harmless Changes script finds that only files within the `.ciignore` file were ignored.
----
## Install
Clone:
```
git clone [email protected]:dollarshaveclub/harmless-changes.git
```
NPM
```
npm i harmless-changes --save-dev
```----
## Use
The documentation below provides steps to using harmless changes
### Make a `.ciignore`
The `.ciignore` file is used to ingore certain files during the ci (build) process
In a terminal:
```bash
touch .ciignore
```### Check if changes are harmless
With CI build steps in **[CircleCI]()** or **[Travis]()**, configure CI to work according to whether harmless exits with a 1 or 0.
Add a script to run harmless changes, in example:
```bash
if npx harmless-changes; then
exit 0
fi# or
# if an older version of NPM is being used
if ./node_modules/.bin/harmless-changes; then
exit 0
fi# or, finally
# if Harmless Changes has not been installed with NPM (the code below is an assumed path)
if ./harmless-changes.sh; then
exit 0
fi
```CI will/can now exit if only harmless changes were made.
----
## Contributing
Please contribute to Harmless Changes by filing an [issue](/issues),responding to issues, or reaching out sociallyโetc.
Harmless Changes is a utility. It may not be beneficial to many repositories if builds are simple. However, as test grow, and project builds become more complex, Harmless Changes is a simple tool that can save lots of time!
----
## Thanks
This utility was thought up and made for [Dollar Shave Club](https://www.dollarshaveclub.com/home) by [Brian Gonzalez](https://github.com/briangonzalez/) and [Jon Ong](https://github.com/jonathanong) while the team was implementing continuous integration. Along with [CircleCi](https://circleci.com/), [ES Check](https://www.npmjs.com/package/es-check), [gh-automerge](https://github.com/jonathanong/gh-automerge), [Greenkeeper](https://greenkeeper.io/), [Jest](https://facebook.github.io/jest/) and [Mocha](https://mochajs.org/), Harmless Changes is a utility that Dollar Shave Club has used to save the company many engineer hours per week with fast builds.