# shipit-assets

> Database syncing tasks for Shipit.

Latest version **1.3.6** (published 2016-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install shipit-assets
pnpm add shipit-assets
yarn add shipit-assets
bun add shipit-assets
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.6 |
| Published | 2016-03-14 |
| First published | 2015-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Tim Kelty |
| Maintainers | fusionary |
| Keywords | shipit, database, task |

## Links

- npm: https://www.npmjs.com/package/shipit-assets
- Repository: https://github.com/timkelty/shipit-assets
- Issues: https://github.com/timkelty/shipit-assets/issues
- npm.io page: https://npm.io/package/shipit-assets

## Dependencies (7)

- [chalk](https://npm.io/package/chalk.md) ^0.5.1
- [path2](https://npm.io/package/path2.md) ^0.1.0
- [lodash](https://npm.io/package/lodash.md) ^2.4.1
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.0
- [bluebird](https://npm.io/package/bluebird.md) ^2.9.1
- [sprintf-js](https://npm.io/package/sprintf-js.md) ^1.0.2
- [shipit-utils](https://npm.io/package/shipit-utils.md) ^1.0.1

## Recent versions

- 1.3.6 (latest) — 2016-03-14
- 1.3.5 — 2015-03-02
- 1.3.4 — 2015-02-24
- 1.3.3 — 2015-02-23
- 1.3.2 — 2015-02-23
- 1.3.1 — 2015-02-20
- 1.3.0 — 2015-02-17
- 1.2.0 — 2015-01-30
- 1.1.0 — 2015-01-30
- 1.0.0 — 2015-01-30

## README

# shipit-assets

Asset syncing tasks for [Shipit](https://github.com/shipitjs/shipit).

**Features:**

- Works via [shipit-cli](https://github.com/shipitjs/shipit) and [grunt-shipit](https://github.com/shipitjs/grunt-shipit)

## Install

```
npm install shipit-assets
```

## Usage

### Example `shipitfile.js`

```js
module.exports = function (shipit) {
  require('shipit-assets')(shipit);

  shipit.initConfig({
    default: {
      assets: {
        paths: ['public/storage'],
        options: {
          ignores: ['cache']
        },
      }
    },
  });
};
```

Push your local assets to remote:

```
shipit staging assets:push
```

Pull your remote assets to local:

```
shipit staging assets:pull
```

### Example `Gruntfile.js`
```js
grunt.initConfig({
    shipit: {
      options: {
        workspace: '/tmp/github-monitor',
        deployTo: '/tmp/deploy_to',
        repositoryUrl: 'https://github.com/user/repo.git',
        ignores: ['.git', 'node_modules'],
        keepReleases: 2,
        key: '/path/to/key',
        shallowClone: true,
        assets: {
          'paths': [
            'public/uploads',
            'backup'
          ]
        },
      },
      staging: {
        servers: 'user@myserver.com'
      }
    }
  });

  grunt.loadNpmTasks('grunt-shipit');
  grunt.loadNpmTasks('shipit-deploy');
  grunt.loadNpmTasks('shipit-assets');
```

To run shipit-assets you have to call:
`grunt shipit:staging assets:push`


## Options (`shipit.config.assets`)

### `assets.paths`

Type: `Array`

Paths to sync between remote and local. Paths are relative to project root.

### `assets.localPaths`

Type: `Array`

If your local paths are mapped differently than remote, you may specify here. If specified, the array must have the same length as `assets.paths`. Default: `assets.paths`

### `assets.options`

Options to pass to [`shipit.remoteCopy`](https://github.com/shipitjs/shipit#shipitremotecopysrc-dest-options-callback).

## Workflow tasks

- assets:push
  - Push assets from local to remote.
  - Emit event "assetsPush".
- assets:pull
  - Pull assets from remote to local.
  - Emit event "assetsPull".

## License

MIT

---
_Source: https://npm.io/package/shipit-assets · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
