Coder Social home page Coder Social logo

travislopes / grunt-dropbox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kbremner/grunt-dropbox

0.0 1.0 0.0 469 KB

Grunt plugin for uploading build artifacts to dropbox

Home Page: http://kbremner.github.io/grunt-dropbox/

License: MIT License

JavaScript 100.00%

grunt-dropbox's Introduction

grunt-dropbox

Grunt plugin for uploading build artifacts to dropbox

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-dropbox --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-dropbox');

The "dropbox" task

Files

When specifying files, the destination must be specified (i.e. specifying the source file only is not supported). The destination is the path from the root of your dropbox directory to upload the local files to.

Options

options.version_name

Type: String Required: False

An optional string value that is appended to the destination path to differentiate artifacts from different builds. If using Travis CI, it is recommended that this be set to process.env.TRAVIS_BUILD_NUMBER.

options.access_token

Type: String Required: True

A string value that is used to authenticate with Dropbox. Note that as this task is meant to be unattended, it is assummed that an access token has already been obtained. See this wiki page for more details.

options.verbose

Type: Boolean Required: False

An optional boolean value that is used to determine if additional information should be logged when the task is executed. It is not recommended to enable this option for CI builds as it will log sensitive information, such as the name of the holder of the dropbox account which the access token is associated with.

Usage Examples

Define a dev task that will upload the dist directory to uploads/sample-project/ in the dropbox account associated with the provided token:

grunt.initConfig({
  dropbox: {
    options: {
      access_token: '<token>'
    },
    dev: {
      files: {
        'uploads/sample-project': ['dist/**/*.*'],
      }
    }
  },
});

Define a dev task that will upload the files in the root of the dist directory to a folder under uploads/sample-project/ named after the current travis build number (i.e. for build number 32, the files will be uploaded to uploads/sample-project/32/). The files are uploaded to the dropbox account associated with the access token provided via the dropbox_access_token environment variable:

grunt.initConfig({
  dropbox: {
    options: {
      access_token: process.env.dropbox_access_token,
      version_name: process.env.TRAVIS_BUILD_NUMBER
    },
    dev: {
      files: {
        'uploads/sample-project': ['dist/*.*'],
      }
    }
  },
});

Contributing

Please feel free to raise issues and submit pull requests. I'll try and reply to issues as quickly as possible.

Release History

  • 0.2.0
    • Uses Dropbox V2 API (PR #15)
  • 0.1.4
    • Fixed #11 which resulted in files being uploaded to an incorrect path
  • 0.1.3
    • Added verbose option, only logs account holder name when this option is set to true (fixes #8)
    • Allow "" to be specified as destination for uploading to root of Dropbox (fixes #10)
  • 0.1.2
    • Made version_name optional
    • Removed default value for access_token
    • Updated documentation
  • 0.1.1
    • moved to using promises, other code cleanup
  • 0.1.0
    • initial release

grunt-dropbox's People

Contributors

kbremner avatar stevehenty 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.