Giter Site home page Giter Site logo

dbln / ci-yarn-upgrade Goto Github PK

View Code? Open in Web Editor NEW

This project forked from taichi/ci-yarn-upgrade

0.0 2.0 0.0 586 KB

Keep NPM dependencies up-to-date with CI, providing version-to-version diff for each library

License: Apache License 2.0

JavaScript 98.00% Shell 2.00%

ci-yarn-upgrade's Introduction

ci-yarn-upgrade CircleCI

This command keeps npm dependencies up-to-date by making pull requests from CI.

ci-yarn-upgrade

This is inspired by bitjourney/ci-npm-update.

Installation

yarn global add ci-yarn-upgrade

Usage

Setting Environment Variables to CircleCI

You can add environment variables using the Project settings > Environment Variables page of your project.

  • You should set GITHUB_ACCESS_TOKEN
  • You may set GIT_USER_NAME and GIT_USER_EMAIL
    • this appliction uses GIT_USER_NAME and GIT_USER_EMAIL for commit

Add DeployKey to GitHub from CircleCI

this command is pushing from build, so you should add read/write deployment key at Project settings > Checkout SSH keys page of your project.

Getting CircleCI API token

API token from your CircleCI account dashboard.

Configure circle.yml

our complete example is here.

Install dependent libraries

you should install yarnpkg before using this command.

dependencies:
  pre:
    # Install Yarn
    - sudo apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3
    - echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
    - sudo apt-get update -qq
    - sudo apt-get install -y -qq yarn

Configure Parameterized Builds

YARN_UPGRADE environment variable is injected from Parameterized Build API.

deployment:
  update-dependencies:
    branch: master
    commands:
      - >
        if [ -n "${YARN_UPGRADE}" ] ; then
          yarn global add ci-yarn-upgrade
          ci-yarn-upgrade --execute
        fi

Command Behavior

By default, ci-yarn-upgrade runs in dry-run mode.

ci-yarn-upgrade

this command works locally and output result to standard output.

dry-run

execution

ci-yarn-upgrade --execute

if you set --execute, this command push branch to remote, and make a pull request.

CLI options

Usage: ci-yarn-upgrade [options]

Keep NPM dependencies up-to-date with CI, providing version-to-version diff for each library

Options:

  -h, --help                   output usage information
  -V, --version                output the version number
  -n, --username <username>    specify the commit auther name. You may set GIT_USER_NAME to environment variable.
  -e, --useremail <useremail>  specify the commit auther email. You may set GIT_USER_EMAIL to environment variable.
  -t, --token <token>          specify personal access token for GitHub. use only for debugging purpose. You should set GITHUB_ACCESS_TOKEN to environment variable.
  --execute                    if you don't specify this option, allows you to test this application.
  -v, --verbose                shows details about the running ci-yarn-upgrade
  -k, --keep                   if you specify this option, keep working branch after all.
  --prefix <prefix>            specify working branch prefix. default prefix is "yarn-upgrade/"
  --workingdir <path>          specify project root dir. it contains package.json. default path is /path/to/myproject
  --with-shadows               if you specify this option, shows shadow dependencies changes.

Development

Setup

git clone https://github.com/taichi/ci-yarn-upgrade
cd ci-yarn-upgrade
yarn install

Heroku Scheduler

If you want to setup heroku schedulers, there's a template for it:

Deploy

To test it, run the following command:

heroku run './build-circleci'

License

Copyright 2016 taichi

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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.