superusers-semversion-demo
Advanced tools
+11
-6
| # Powershell | ||
| # semantic git deploy | ||
| param( $message = "Fix" ) | ||
| param( | ||
| [Parameter(Mandatory=$false)] | ||
| [String] [ValidateSet("broken","feature","fix")] | ||
| $version = "fix" | ||
| ) | ||
| git add . | ||
| git commit -am $version | ||
| git commit -am "$message" | ||
| switch ($version) { | ||
| "broken" { npm version major } | ||
| "feature" { npm version minor } | ||
| Default { npm version patch } | ||
| } | ||
| npm version patch | ||
| git push origin master --force --follow-tags --quiet | ||
| $package_version = node -p "require('./package.json').version" | ||
| Write-Host "Releasing Version: $package_version" -ForegroundColor Green |
+4
-2
| { | ||
| "name": "superusers-semversion-demo", | ||
| "description": "using semantic versioning", | ||
| "version": "1.2.1", | ||
| "version": "1.2.2", | ||
| "dependencies": { | ||
@@ -20,3 +20,5 @@ "node-fetch": "^2.6.0" | ||
| "predeploy": "npm run validation", | ||
| "deploy": "powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./deploy.ps1", | ||
| "deploy": "powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./deploy.ps1 fix", | ||
| "deploy-feature": "powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./deploy.ps1 feature ", | ||
| "deploy-broken": "powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./deploy.ps1 broken ", | ||
| "devops-status": "powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./devops.ps1" | ||
@@ -23,0 +25,0 @@ }, |
5361
5.72%