Coder Social home page Coder Social logo

entria-deploy's Introduction

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

environment:
    CIRCLECI_COMPARE_URL: << pipeline.project.git_url >>/compare/<< pipeline.git.base_revision >>...<<pipeline.git.revision>>

Get files to be tested by jest

TESTFILES=$(yarn entria-deploy changes $CIRCLECI_COMPARE_URL)
yarn jest --maxWorkers=3 --coverage --forceExit --ci

Check if you need to deploy some package

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

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');

entria-deploy's People

Contributors

daniloab avatar dependabot[bot] avatar eokoneyo avatar jgcmarins avatar sibelius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

entria-deploy's Issues

Add cli option for packages directory name

Hey, nice work @sibelius ๐Ÿ‘ , as always, I can find your contributions whenever I go looking to solve a problem.

I have a proposal. I am looking to solve a situation in which I need to trigger a workflow on directory changes for bit.dev. Here is need..

Basically I won't be using changes to the packages directory to trigger the flow. So my proposal is to allow a command line option [-d, --dir] <folder-name> to the cli to swap out the name for the default folder name packages.

Usage:

  entria-deploy components --dir bit-staging

would you accept a PR?

btw, I saw comments about pipelines, but we have a self-hosted circle server so can't use that.

handle missing CIRCLE_COMPARE_URL

sometimes CircleCI does not provide a CIRCLE_COMPARE_URL

My idea in this case is to diff against the last merge, so we know which changed after a pull request is merged

Package is not deployed to npm/yarn

When I run yarn global add @entria/deploy (command from docs) I get

error An unexpected error occurred: "https://registry.yarnpkg.com/@entria%2fdeploy: Not found".

Also search on yarnpkg shows not result.

Are you about to deploy this package or should I use some another solution?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.