GithubHelp home page GithubHelp logo

arkdelkaos / nx-remotecache-gcs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wvanderdeijl/nx-remotecache-gcs

0.0 1.0 0.0 481 KB

Task runner for @nrwl/nx with remote caching using Google Cloud Storage

TypeScript 84.30% JavaScript 13.87% Shell 1.82%

nx-remotecache-gcs's Introduction

nx-remotecache-gcs

A task runner for @nrwl/nx that uses a Google Cloud Storage bucket as a remote cache, so all team members and CI servers can share a single cache. The concept and benefits of computation caching are explained in the NX documentation.

setup

npm install --save-dev nx-remotecache-gcs

create a Google Cloud Storage bucket. Since this is only a cache, there is no need for a dual- or multi-region bucket, so choose a single location near you.

gsutil mb -p [PROJECT_ID] -l [BUCKET_LOCATION] -b on gs://[BUCKET_NAME]/

setup a lifecycle rule for your storage bucket to automatically delete old files. If you want to use our suggested auto-delete-after-30-days rule, you can simply use the json that is included:

gsutil lifecycle set node_modules/nx-remotecache-gcs/lifecycle.json gs://[BUCKET_NAME]

by default all viewers, editors and owners of your Google Cloud project can read and/or write to the bucket. You could also restrict who can read and write the bucket to only allow certain users or (build server) service accounts.

finally, add tasksRunnerOptions in your nx.json file

{
    "projects": {
        ...
    },
    "tasksRunnerOptions": {
        "default": {
            "runner": "nx-remotecache-gcs",
            "options": {
                "bucket": "gs://NAME-OF-YOUR-STORAGE-BUCKET",
                "cacheableOperations": [
                    "build",
                    "test",
                    "lint",
                    "e2e"
                ]
            }
        }
    }
}

run a build and see if files end up in your cache storage bucket:

nx run-many --target=build --all

nx-remotecache-gcs's People

Contributors

arkdelkaos avatar dependabot[bot] avatar wvanderdeijl avatar

Watchers

 avatar

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.