A git diff based approach to package and deploy server apps of any kind.
npm install sitbackpm2/IIS/etc.
sitback and relax.
npm install --save sitback
`
Usage example
Packing / unpacking:
`cmd
sitback --pack=deploy.json --base=C:\\Users\\User\\Projects\\git\\my_app" --out=C:\\Users\\User\\Projects\\out --git-from=prod_latest --git-to=prod_next
.
.
.
sitback --unpack=/var/incoming/my_app.json --out=/var/app
sitback --unpack=/var/incoming/another_app.json --out=/var/another_app
`
deploy.json:
`json
[
{
"name": "my_app",
"variables": {
"trigger_js_build": {
"git_diff": { "pattern": "js/*/" }
},
"trigger_net_build": {
"git_diff": { "pattern": "core/*/.cs" }
}
},
"actions": [
{
"condition": "trigger_js_build",
"type": "cmd",
"description": "Building JS code...",
"options": {
"path": "npm run build",
"args": ["--dist"]
}
},
{
"condition": "trigger_net_build",
"type": "msbuild",
"description": "Building .NET code...",
"options": {
"solution": "core/app.sln",
"target": "app:Rebuild",
"props": {
"Configuration": "Release",
"Platform": "Any CPU"
}
}
}
],
"package": [
{
"condition": "trigger_js_build",
"source": "dist",
"dest": "js",
"pattern": "app.js",
"mode": "sync"
},
{
"condition": "trigger_net_build",
"source": "core/Bin/Release",
"dest": "bin",
"pattern": "*/",
"mode": "sync"
},
{
"condition": "trigger_net_build",
"source": "libs",
"dest": "bin",
"pattern": "*.dll",
"mode": "sync"
},
{
"source": "resources",
"dest": "resources",
"pattern": "*/",
"mode": "git_diff"
}
]
},
{
"name": "another_app",
"variables": {
"trigger_js_build": {
"git_diff": { "pattern": "js/*/" }
}
},
"actions": [
{
"condition": "trigger_js_build",
"type": "cmd",
"description": "Building JS code...",
"options": {
"path": "npm run build",
"args": ["--dist"]
}
}
],
"package": [
{
"condition": "trigger_js_build",
"source": "dist",
"dest": "js",
"pattern": "app.js",
"mode": "sync"
},
{
"source": "resources",
"dest": "resources",
"pattern": "*/",
"mode": "git_diff"
},
{
"source": "web.confg",
"dest": "web.confg",
"sourceXmlPath": "$.configuration.runtime",
"destXmlPath": "$.configuration.runtime",
"mode": "xml_replace"
}
]
}
]
``