# How to bundle a SMILE application?
To bundle the full application:
[Lottery] $ smile clean; prepare; generate; compile; [Lottery] $ bundle ... info] release file created at : /Users/pallavi/training/lottery/release/lottery-lottery-0.1.zipTo create a custom bundle:
Define the bundle in ksmile with the modules that needs to be included. For example, to create a bundle with name
lottery_readof only the projection related modules:bundle lottery_read(LotteryStream, LotteryQuery, LotteryReadMongo)run command
bundle <bundle-name>[Lottery] $ bundle lottery_read ... [info] release file created at : /Users/pallavi/training/lottery/release/lottery-lottery_read-0.1.zipYou can also create a bundle and include all the components as follows:
bundle pack allIn this case the bundle will be created with name lottery-pack-0.1.zip
To create an environment specific bundle:
- Inside the bundle folder within project-home/release, create a folder with the env name, for example:
stage
@$:~/training/lottery/release/lottery_read>mkdir stage- copy the start & stop server scripts from the
project-home/release/<bundle-name>folder.
@$:~/training/lottery/release/lottery_read>cp *.sh stage/- Update the scripts to include the env-name For example: edit start-server.sh as follows:
nohup ./bin/lottery -Dsmile.env=stage -Dhttp.port=9000 -Dpidfile.path=play.pid &Consider this folder as the placeholder for any env specific files that needs to go into the bundle.
- run command
bundle <bundle-name> <env-name>
[Lottery] $ bundle lottery_read stage ... [info] release file created at : /Users/pallavi/training/lottery/release/lottery-lottery_read-0.1.zip- Inside the bundle folder within project-home/release, create a folder with the env name, for example:
Note: In all the above cases the bundle gets created inside project-home/release folder with a .zip extension.