deploy mono web/asp.net application base on Shipit-deploy
npm install shipit-mono
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',
buildTool:'msbuild', //or xbuild
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
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.
Type: String
Default: same as workspace
Define directory within the workspace which should be deployed.
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.
Type: String
Git URL of the project repository.
Type: String
Tag, branch or commit to deploy.
Type: Array<String>
An array of paths that match ignored files. These paths are used in the rsync command.
Type: Boolean
Whether or not to delete the old release when rolling back to a previous release.
Type: String
Path to SSH key
Type: Number
Number of releases to keep on the remote server.
Type: String
transform Web.config using xdt(Microsoft Xml Document Transformation). Default: ''
Example:
xdt = Release
Web.config + Web.Release.config -> Web.config
Type: Boolean
Perform a shallow clone. Default: false
.
###updateSubmodules
Type: Boolean
Update submodules. Default: false
.
Type: String
Log format to pass to git log
. Used to display revision diffs in pending
task. Default: %h: %s - %an
.
Type: String
Parameter to pass to cp
to copy the previous release. Non NTFS filesystems support -r
. Default: -a
Several variables are attached during the deploy and the rollback process:
All options described in the config sections are available in the shipit.config
object.
Attached during deploy:fetch
task.
You can manipulate the repository using git command, the API is describe in gift.
Attached during deploy:update
and rollback:init
task.
The current release dirname of the project, the format used is "YYYYMMDDHHmmss" (moment format).
Attached during deploy:init
, rollback:init
, and pending:log
tasks.
The remote releases path.
Attached during deploy:update
and rollback:init
task.
The complete release path : path.join(shipit.releasesPath, shipit.releaseDirname)
.
Attached during deploy:init
, rollback:init
, and pending:log
tasks.
The current symlink path : path.join(shipit.config.deployTo, 'current')
.
Type:String
Attached during deploy:build
task. default msbuild
options: msbuild
or xbuild
Type: String
Attached during deploy:build
task.
solution(*.sln) directory within the workspace
Type: String
Attached during deploy:build
task.
.net framework version.
Type: String
Attached during deploy:build
task.
xbuild configuration
Type: String
Attached during deploy:build
task.
web.csproj within the workspace which should be deployed.
Type:Object
extra properties
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".
- deploy:init
- 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".
- rollback:init
- pending
- pending:log
- Log pending commits (diff between HEAD and currently deployed revision) to console.
- pending:log
- git 1.7.8+
- rsync 3+
- OpenSSH 5+
- mono
- xamarin studio
MIT