Resin Cloud Deployment Reference
From Resin 3.0
(→Deploying to a staging server) |
(→Deploying to a staging server) |
||
Line 175: | Line 175: | ||
=== Deploying to a staging server === | === Deploying to a staging server === | ||
− | Deploy to staging server | + | Deploy to staging server. |
<code> | <code> | ||
Line 186: | Line 186: | ||
</pre> | </pre> | ||
</code> | </code> | ||
+ | |||
+ | The staging name is logical. You can call it anything. The app will not be served unless | ||
+ | the server is started with this staging name. | ||
Showing items deployed to staging server. | Showing items deployed to staging server. | ||
Line 251: | Line 254: | ||
-debug-port <port> : configure a debug port | -debug-port <port> : configure a debug port | ||
-jmx-port <port> : configure an unauthenticated jmx port | -jmx-port <port> : configure an unauthenticated jmx port | ||
+ | -stage <staging-name> : The stage the server is serving (default production) | ||
</pre> | </pre> | ||
</code> | </code> | ||
Line 265: | Line 269: | ||
$ wget localhost:8080/blogz | $ wget localhost:8080/blogz | ||
... | ... | ||
+ | ... | ||
+ | HTTP request sent, awaiting response... 200 OK | ||
+ | </pre> | ||
+ | </code> | ||
+ | |||
+ | |||
+ | === Deploying to a preview staging server === | ||
+ | |||
+ | |||
+ | <code> | ||
+ | <pre> | ||
+ | |||
+ | $ resinctl deploy ./target/blog-0.1.0.BUILD-SNAPSHOT.war -name blogp -version 0.1.0 -stage preview | ||
+ | |||
+ | '''Output''' | ||
+ | Deployed preview/webapp/default/blogp-0.1.0 from \ | ||
+ | ./target/blog-0.1.0.BUILD-SNAPSHOT.war to hmux://127.0.0.1:6800 | ||
+ | |||
+ | $ resinctl deploy-list | ||
+ | |||
+ | '''Output''' | ||
+ | preview/webapp/default/blogp-0.1.0 | ||
+ | production/webapp/default/blog-0.1.0 | ||
+ | ... | ||
+ | </pre> | ||
+ | </code> | ||
+ | |||
+ | |||
+ | Restart the server in preview stage, since preview staging is a common thing, you can just use the -preview command. | ||
+ | |||
+ | |||
+ | <code> | ||
+ | <pre> | ||
+ | $ resinctl stop | ||
+ | |||
+ | '''Output''': | ||
+ | Resin/4.0.24 stopped -server 'app-0' for watchdog at 127.0.0.1:6600 | ||
+ | |||
+ | $ sudo resinctl start -preview | ||
+ | |||
+ | '''Output''': | ||
+ | Resin/4.0.24 launching watchdog at 127.0.0.1:6600 | ||
+ | Resin/4.0.24 started -server 'app-0' for watchdog at 127.0.0.1:6600 | ||
+ | </pre> | ||
+ | </code> | ||
+ | |||
+ | |||
+ | Now the preview blog site is available. | ||
+ | |||
+ | <code> | ||
+ | <pre> | ||
+ | $ wget localhost:8080/blogp | ||
... | ... | ||
HTTP request sent, awaiting response... 200 OK | HTTP request sent, awaiting response... 200 OK | ||
</pre> | </pre> | ||
</code> | </code> |
Revision as of 23:37, 5 December 2011
- Deploying to a local server
- Deploying to a remote server
- Setting up a user and password
- Setting up a cloud topology
- Deploying to the Triad
- license-add enabling Resin features
- Deploy to a staging server
- Setting up load balancer to not to deploy to staging server
- Common tasks
- Deploying a new application deploy
- Listing current versions of deployed application
- Undeploying a new application
- Using deploy-copy to promote a release to production
- Using deploy-copy to rollback a release that was deployed to production
- Installing mysql driver for a web application using config-deploy
- Showing what is in remote config with config-list-ls and config-list-cat
- web-app-deploy settings
$ resinctl | grep deploy deploy - deploys an application deploy-copy - copies an application deploy-list - lists all deployed applications deploy-restart - restarts an application deploy-start - starts an application deploy-stop - stops an application undeploy - undeploys an application config-deploy - deploys configuration directory config-undeploy - undeploys a config $ resinctl | grep config config-deploy - deploys configuration directory config-copy - copies configuration config-list - lists all deployed configurations config-list-ls - list contents of config dir (ex. ./lib) config-list-cat - list contents of config file config-undeploy - undeploys a config
Deploying to a local server
Deploy commands available
$ resinctl help deploy Output: usage: bin/resin.sh [-conf <file>] [-server <id>] deploy -user <user> \ -password <password> [options] <war-file> description: deploys application specified in a <war-file> to resin server options: -conf <file> : resin configuration file -server <id> : id of a server -address <address> : ip or host name of the server -port <port> : server http port -user <user> : user name used for authentication to the server -password <password> : password used for authentication to the server -host <host> : virtual host to make application available on -name <name> : name of the context to deploy to, defaults to war-file name -stage <stage> : stage to deploy application to, defaults to production -version <version> : version of application formatted as <major.minor.micro.qualifier> -m <message> : commit message
Turning on versioning:
$ cat /etc/resin/resin.properties | grep deploy Output: deploy_versioning : true
$ sudo grep "web-app-deploy" -A 1 /etc/resin/resin.xml Output: <web-app-deploy path="webapps" versioning="${deploy_versioning}" expand-preserve-fileset="WEB-INF/work/**"/>
"if true, use the web-app's numeric suffix as a version"
Run deploy command passing location of war file.
$ resinctl deploy ./target/blog-0.1.0.war -name blog Output: Deployed production/webapp/default/blog from \ ./target/blog-0.1.0.war to hmux://127.0.0.1:6800
To see the deployed you can use resinctl deploy-list
$ resinctl deploy-list Output: production/webapp/default/blog
- TODO explain production/webapp/default/blog
- TODO add a table
- TODO explain how to start up a server with different staging servers
Now undeploy it:
$ resinctl undeploy blog Output: Undeployed blog from hmux://127.0.0.1:6800
At this point there should be nothing
$ resinctl deploy-list
Now deploy it with versioning:
$ resinctl deploy ./target/blog-0.1.0.BUILD-SNAPSHOT.war -name blog -version 0.1.0 Output: Deployed production/webapp/default/blog-0.1.0 from \ ./target/blog-0.1.0.BUILD-SNAPSHOT.war to hmux://127.0.0.1:6800
Blog application is under the version 0.1.0
$ resinctl deploy-list Output: production/webapp/default/blog-0.1.0
- TODO explain production/webapp/default/blog-0.1.0
- TODO add a table
- TODO explain how to start up a server with different staging servers
Deploying to a staging server
Deploy to staging server.
$ resinctl deploy ./target/blog-0.1.0.BUILD-SNAPSHOT.war -name blogz -version 0.1.0 -stage staging Output Deployed staging/webapp/default/blogz-0.1.0 from \ ./target/blog-0.1.0.BUILD-SNAPSHOT.war to hmux://127.0.0.1:6800
The staging name is logical. You can call it anything. The app will not be served unless the server is started with this staging name.
Showing items deployed to staging server.
$ resinctl deploy-list production/webapp/default/blog-0.1.0 staging/webapp/default/blogz-0.1.0
The /blog works but /blogz does not work because server is by default setup as production server.
/blog works because server is setup for production
$ wget localhost:8080/blog ... HTTP request sent, awaiting response... 200 OK
/blogz does not work because server is not setup for production
$ wget localhost:8080/blogz ... HTTP request sent, awaiting response... 404 Not Found
To run the server as a staging server do the following:
$ resinctl stop Output: Resin/4.0.24 stopped -server 'app-0' for watchdog at 127.0.0.1:6600
$ resinctl help start Output: usage: bin/resin.sh [-options] start where options include: -conf <file> : select a configuration file -data-directory <dir> : select a resin-data directory -join-cluster <cluster> : join a cluster as a dynamic server -log-directory <dir> : select a logging directory -resin-home <dir> : select a resin home directory -root-directory <dir> : select a root directory -server <id> : select a <server> to run -watchdog-port <port> : override the watchdog-port -verbose : print verbose starting information -preview : run as a preview server -debug-port <port> : configure a debug port -jmx-port <port> : configure an unauthenticated jmx port -stage <staging-name> : The stage the server is serving (default production)
$ sudo resinctl start -stage staging Output: Resin/4.0.24 launching watchdog at 127.0.0.1:6600 Resin/4.0.24 started -server 'app-0' for watchdog at 127.0.0.1:6600 $ wget localhost:8080/blogz ... ... HTTP request sent, awaiting response... 200 OK
Deploying to a preview staging server
$ resinctl deploy ./target/blog-0.1.0.BUILD-SNAPSHOT.war -name blogp -version 0.1.0 -stage preview '''Output''' Deployed preview/webapp/default/blogp-0.1.0 from \ ./target/blog-0.1.0.BUILD-SNAPSHOT.war to hmux://127.0.0.1:6800 $ resinctl deploy-list '''Output''' preview/webapp/default/blogp-0.1.0 production/webapp/default/blog-0.1.0 ...
Restart the server in preview stage, since preview staging is a common thing, you can just use the -preview command.
$ resinctl stop '''Output''': Resin/4.0.24 stopped -server 'app-0' for watchdog at 127.0.0.1:6600 $ sudo resinctl start -preview '''Output''': Resin/4.0.24 launching watchdog at 127.0.0.1:6600 Resin/4.0.24 started -server 'app-0' for watchdog at 127.0.0.1:6600
Now the preview blog site is available.
$ wget localhost:8080/blogp ... HTTP request sent, awaiting response... 200 OK