Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/entria/entria-deploy
Entria Deploy helpers
https://github.com/entria/entria-deploy
deploy entria lerna monorepo
Last synced: 6 days ago
JSON representation
Entria Deploy helpers
- Host: GitHub
- URL: https://github.com/entria/entria-deploy
- Owner: entria
- Created: 2018-11-12T00:37:16.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-08-31T00:11:20.000Z (2 months ago)
- Last Synced: 2024-10-02T11:39:45.475Z (about 1 month ago)
- Topics: deploy, entria, lerna, monorepo
- Language: TypeScript
- Size: 1.43 MB
- Stars: 56
- Watchers: 7
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome - entria-deploy - Entria Deploy helpers (TypeScript)
README
# Entria Deploy
- Gives a list of paths that changed from a compare url, example below:
```
https://github.com/sibelius/monorepo-101/compare/1662e1d...0edb974
```- Check if a determined path has changed from a compare url
## How to install
```
yarn add @entria/deploy --dev
```## Usage with CircleCI
Add CIRCLECI_COMPARE_URL environment to your .circleci/config.yml
```jsx
environment:
CIRCLECI_COMPARE_URL: << pipeline.project.git_url >>/compare/<< pipeline.git.base_revision >>...<>
```### Get files to be tested by jest
```jsx
TESTFILES=$(yarn entria-deploy changes $CIRCLECI_COMPARE_URL)
yarn jest --maxWorkers=3 --coverage --forceExit --ci
```### Check if you need to deploy some package
```jsx
SHOULD_BUILD=$(yarn entria-deploy hasChanged $CIRCLECI_COMPARE_URL packages/api)
if [ "$SHOULD_BUILD" == false ]; then
circleci-agent step halt
fi
```## Usage in JavaScript/TypeScript
```jsx
import { shouldDeployPackage, changedPaths } from '@entria/deploy';// it should be another compare url, from Travir of instance
const shouldDeploy = shouldDeployPackage(process.cwd())(process.env.CIRCLE_COMPARE_URL);if (shouldDeploy('packages/server') {
console.log('deploy server');
}const allchanges = await changedPaths(process.env.CIRCLE_COMPARE_URL);
console.log('all changes');
```