# shipit-mono

> shipit mono deploy

Latest version **1.2.0** (published 2017-05-15) · MIT license · 0 weekly downloads

## Install

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

## 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.2.0 |
| Published | 2017-05-15 |
| First published | 2016-04-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | feiin |
| Maintainers | feiin |
| Keywords | shipit, mono, deploy, asp.net deploy |

## Links

- npm: https://www.npmjs.com/package/shipit-mono
- Repository: https://github.com/feiin/shipit-mono
- Homepage: https://github.com/feiin/shipit-mono#readme
- Issues: https://github.com/feiin/shipit-mono/issues
- npm.io page: https://npm.io/package/shipit-mono

## Dependencies (10)

- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [lodash](https://npm.io/package/lodash.md) ^4.6.1
- [shipit](https://npm.io/package/shipit.md) ^0.8.11
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.16
- [bluebird](https://npm.io/package/bluebird.md) ^3.3.4
- [fs-extra](https://npm.io/package/fs-extra.md) ^0.26.7
- [node-xdt](https://npm.io/package/node-xdt.md) ^1.2.1
- [shipit-utils](https://npm.io/package/shipit-utils.md) ^1.3.0
- [vssln-parser](https://npm.io/package/vssln-parser.md) ^0.1.4
- [shipit-deploy](https://npm.io/package/shipit-deploy.md) ^2.2.0

## Recent versions

- 1.2.0 (latest) — 2017-05-15
- 1.1.4 — 2017-04-17
- 1.1.3 — 2017-04-17
- 1.1.2 — 2017-04-17
- 1.1.1 — 2017-04-17
- 1.0.0 — 2017-04-17
- 0.3.0 — 2016-05-19
- 0.2.0 — 2016-05-13
- 0.1.4 — 2016-04-02
- 0.1.3 — 2016-04-01
- 0.1.2 — 2016-04-01
- 0.1.1 — 2016-04-01
- 0.1.0 — 2016-04-01

## README

##shipit-mono

[![Build Status](https://travis-ci.org/feiin/shipit-mono.svg?branch=master)](https://travis-ci.org/feiin/shipit-mono)
[![npm](https://img.shields.io/npm/dt/shipit-mono.svg?maxAge=2592000)]()

deploy mono web/asp.net application base on [Shipit-deploy](https://github.com/shipitjs/shipit-deploy)

 

## Install

```
npm install shipit-mono
```

## Usage

### Example `shipitfile.js`

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

  shipit.initConfig({
    default: {
      workspace: '/tmp/github-monitor',
      deployTo: '/tmp/deploy_to',
      repositoryUrl: 'https://github.com/user/repo.git',
      ignores: ['.git', 'node_modules'],
      keepReleases: 2,
      xdt:'Release'
      shallowClone: false,
      xbuild:{
                solutionPath:'./src/Kings.sln',
                target:'Kings.Web',
                properties:{
                    Configuration:'Release'
                }
            }
    },
    staging: {
      servers: 'user@myserver.com'
    }
  });
};
```

To deploy on staging, you must use the following command :

```
shipit staging deploy
```

You can rollback to the previous releases with the command :

```
shipit staging rollback
```

## Options

### workspace

Type: `String`

Define a path to an empty directory where Shipit builds it's syncing source. **Beware to not set this path to the root of your repository as shipit-deploy cleans the directory at the given path as a first step.**

### dirToCopy

Type: `String`
Default: same as workspace

Define directory within the workspace which should be deployed.

### deployTo

Type: `String`

Define the remote path where the project will be deployed. A directory `releases` is automatically created. A symlink `current` is linked to the current release.

### repositoryUrl

Type: `String`

Git URL of the project repository.

### branch

Type: `String`

Tag, branch or commit to deploy.

### ignores

Type: `Array<String>`

An array of paths that match ignored files. These paths are used in the rsync command.

### deleteOnRollback

Type: `Boolean`

Whether or not to delete the old release when rolling back to a previous release.

#### key

Type: `String`

Path to SSH key

### keepReleases

Type: `Number`

Number of releases to keep on the remote server.

### xdt

Type: `String`

 transform Web.config using xdt(Microsoft Xml Document Transformation). Default: ''

Example: 

xdt = `Release`

```
 Web.config + Web.Release.config  -> Web.config  
 
```

### shallowClone

Type: `Boolean`

Perform a shallow clone. Default: `false`.

###updateSubmodules

Type: `Boolean`

Update submodules. Default: `false`.



### gitLogFormat

Type: `String`

Log format to pass to [`git log`](http://git-scm.com/docs/git-log#_pretty_formats). Used to display revision diffs in `pending` task. Default: `%h: %s - %an`.

### copy

Type: `String`

Parameter to pass to `cp` to copy the previous release. Non NTFS filesystems support `-r`. Default: `-a`

## Variables

Several variables are attached during the deploy and the rollback process:

### shipit.config.*

All options described in the config sections are available in the `shipit.config` object.

### shipit.repository

Attached during `deploy:fetch` task.

You can manipulate the repository using git command, the API is describe in [gift](https://github.com/sentientwaffle/gift).

### shipit.releaseDirname

Attached during `deploy:update` and `rollback:init` task.

The current release dirname of the project, the format used is "YYYYMMDDHHmmss" (moment format).

### shipit.releasesPath

Attached during `deploy:init`, `rollback:init`, and `pending:log` tasks.

The remote releases path.

### shipit.releasePath

Attached during `deploy:update` and `rollback:init` task.

The complete release path : `path.join(shipit.releasesPath, shipit.releaseDirname)`.

### shipit.currentPath

Attached during `deploy:init`, `rollback:init`, and `pending:log` tasks.

The current symlink path : `path.join(shipit.config.deployTo, 'current')`.

###xbuild

####buildTool
Type:`String`
Attached during `deploy:build` task.  default `msbuild`

options: `msbuild` or `xbuild`


####solutionDir

Type: `String`

Attached during `deploy:build` task.  

solution(*.sln) directory within the workspace

####framework

Type: `String`

Attached during `deploy:build` task.  

.net  framework version.

####configuration

Type: `String`

Attached during `deploy:build` task.  

xbuild configuration

####csprojPath

Type: `String`


Attached during `deploy:build` task.  

web.csproj within the workspace which should be deployed.


####properties
Type:`Object`

extra properties



## Workflow tasks

the same with shipit-deploy

- deploy
  - deploy:init
    - Emit event "deploy".
  - deploy:fetch
    - Create workspace.
    - Initialize repository.
    - Add remote.
    - Fetch repository.
    - Checkout commit-ish.
    - Merge remote branch in local branch.
    - Emit event "fetched".
  - deploy:build
    - nuget restore.
    - xbuild csproj.
    - cp release contents & bin.
    - Emit event "builded".
  - deploy:update
    - Create and define release path.
    - Remote copy project.
    - Emit event "updated".
  - deploy:publish
    - Update symlink.
    - Emit event "published".
  - deploy:clean
    - Remove old releases.
    - Emit event "cleaned".
  - deploy:finish
    - Emit event "deployed".
- rollback
  - rollback:init
    - Define release path.
    - Emit event "rollback".
  - deploy:publish
    - Update symlink.
    - Emit event "published".
  - deploy:clean
    - Remove old releases.
    - Emit event "cleaned".
  - rollback:finish
    - Emit event "rollbacked".
- pending
  - pending:log
    - Log pending commits (diff between HEAD and currently deployed revision) to console.

## Dependencies

### Local

- git 1.7.8+
- rsync 3+
- OpenSSH 5+
- mono
- xamarin studio

## License

MIT

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