It's a SBT plugin for SBT project deployment. Steps of deployment:
- compile project locally and package it to "zip" archive (thanks to sbt-native-packager)
- connect to remote server using SSH
- make required file structure in app directory (in first time):
├── current -> ../releases/20150090083000/ ├── releases │ ├── 20150090083000 │ └── 20150080072500 ├── tmp │ └── 20150090083000.zip └── shared └── <linked_files and linked_dirs>
- copy obtained archive to remote server, extract it and invoke
stop/start
scripts - goto step 2 with next app server (if multiple server deploy configured)
-
Integrate with your SBT project:
Add to
project/plugins.sbt
addSbtPlugin("com.github.somewater" % "sbt-onebutton-deploy" % "0.0.2")
Add to
build.sbt
enablePlugins(DeployPlugin)
-
Generate deploy config from template, run:
sbt deployGenerateConf
Edit new config placed in
conf/deploy.conf
-
Server setup:
- required: create start/stop scripts for service, for example using runit
- optional: create directory for project logs (or other release-shared files like local config etc.)
-
Checkout VCS to required project state
-
Run deploy:
sbt deploy
Or run deploy on non-default stage:
sbt "deploy production"
- Deployment tested on linux servers
- SSH access to remote servers with required permissions
- unzip utility should be installed on all remote servers (installed by default on most linux distributions)
This project is licensed under the terms of the MIT license.