GithubHelp home page GithubHelp logo

fpie2's Introduction

File Packer Include/Exclude 2

build

Usage: fpie2 [OPTIONS] <CONTEXTDIR> <INCLUDEFILE>

FPIE2 tarballs a directory based on glob-patterns in an include/exclude-file

Options:
  --print-files		Print files to be included instead of emitting tarball

INCLUDEFILE syntax:
  Each line is a rule to include or exclude filepath(s) in CONTEXTDIR,
  and paths are defined relative to the context path.
  You can include a file:
    > some-file
  Or all files in a folder:
    > some-dir/
  (you can also use a trailing * to specify a directory, i.e. "some-dir/*")
  Prepend "!" for exclusions:
    > !some-file-to-exclude
  Or exclude an entire directory:
    > !some-dir-to-exclude/
  All entries are expanded as glob patterns, e.g.:
    > **/package.json
    > !**/node_modules
  Comments are lines that start with "#":
    > # This is a comment

Why?

FPIE2 is designed to generate optimal contexts for Docker building when you want to pull code in from outside current working directory.

Consider the following folder-structure:

src/
    project/
        .includefile
        Dockerfile
        index.js
        node_modules/
            <thousands of files>
    lib/
        index.js
        node_modules/
            <thousands of files>

We want to build project, but also include lib in the context. We don't want the node_modules folders to be included.

We build project by piping the output of FPIE2 into Docker, like this:

src/project$ cat .includefile
project/
lib/
!**/node_modules/
src/project$ fpie .. .includefile | docker build -f project/Dockerfile -

Contributing

This project relies on nexe and as such is sensitive to what version of node.js you're running.

I run:

$ node --version
v.12.16.2

Cut a new release

Run npm version <major|minor|patch> and git push --tags, then create a new release in GitHub. CI will automatically populate the release with binaries.

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.