kontena-plugin-app-command 0.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +21 -0
  5. data/Dockerfile +19 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +191 -0
  8. data/README.md +299 -0
  9. data/Rakefile +6 -0
  10. data/kontena-plugin-app-command.gemspec +28 -0
  11. data/lib/kontena/cli/apps/build_command.rb +28 -0
  12. data/lib/kontena/cli/apps/common.rb +172 -0
  13. data/lib/kontena/cli/apps/config_command.rb +25 -0
  14. data/lib/kontena/cli/apps/deploy_command.rb +137 -0
  15. data/lib/kontena/cli/apps/docker_compose_generator.rb +61 -0
  16. data/lib/kontena/cli/apps/docker_helper.rb +80 -0
  17. data/lib/kontena/cli/apps/dockerfile_generator.rb +16 -0
  18. data/lib/kontena/cli/apps/init_command.rb +89 -0
  19. data/lib/kontena/cli/apps/kontena_yml_generator.rb +105 -0
  20. data/lib/kontena/cli/apps/list_command.rb +59 -0
  21. data/lib/kontena/cli/apps/logs_command.rb +37 -0
  22. data/lib/kontena/cli/apps/monitor_command.rb +93 -0
  23. data/lib/kontena/cli/apps/remove_command.rb +74 -0
  24. data/lib/kontena/cli/apps/restart_command.rb +39 -0
  25. data/lib/kontena/cli/apps/scale_command.rb +33 -0
  26. data/lib/kontena/cli/apps/service_generator.rb +114 -0
  27. data/lib/kontena/cli/apps/service_generator_v2.rb +27 -0
  28. data/lib/kontena/cli/apps/show_command.rb +23 -0
  29. data/lib/kontena/cli/apps/start_command.rb +40 -0
  30. data/lib/kontena/cli/apps/stop_command.rb +40 -0
  31. data/lib/kontena/cli/apps/yaml/custom_validators/affinities_validator.rb +19 -0
  32. data/lib/kontena/cli/apps/yaml/custom_validators/build_validator.rb +22 -0
  33. data/lib/kontena/cli/apps/yaml/custom_validators/extends_validator.rb +20 -0
  34. data/lib/kontena/cli/apps/yaml/custom_validators/hooks_validator.rb +54 -0
  35. data/lib/kontena/cli/apps/yaml/custom_validators/secrets_validator.rb +22 -0
  36. data/lib/kontena/cli/apps/yaml/reader.rb +213 -0
  37. data/lib/kontena/cli/apps/yaml/service_extender.rb +77 -0
  38. data/lib/kontena/cli/apps/yaml/validations.rb +71 -0
  39. data/lib/kontena/cli/apps/yaml/validator.rb +38 -0
  40. data/lib/kontena/cli/apps/yaml/validator_v2.rb +53 -0
  41. data/lib/kontena/plugin/app-command/app_command.rb +21 -0
  42. data/lib/kontena/plugin/app-command/version.rb +7 -0
  43. data/lib/kontena_cli_plugin.rb +4 -0
  44. metadata +143 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2abc67629273b9e6c15006ff20de87faf5188d4e
4
+ data.tar.gz: daa28184df495745720b1b3e37405b630f24baef
5
+ SHA512:
6
+ metadata.gz: 94a1e66085aa971577acf722382f5353ffe986a74b6f6110e1d0ad015fc3e82f54d973a93101da446ae7365fe19f4d7a2ae6679db165a2fa53e987760a3108cd
7
+ data.tar.gz: f693c1ea56742ec9284bd1e43dee3e646865142da3deec3cfdd3d9f25c90bb7cafd3fdaa156dea7932c5d2f8bf101e102973753fcabc04f7968ea270583bc2c5
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ .idea
16
+ *.gem
17
+ /vendor/
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,21 @@
1
+ sudo: required
2
+ language: ruby
3
+ services:
4
+ - docker
5
+ rvm:
6
+ - 2.1.10
7
+ - 2.2.6
8
+ - 2.3.3
9
+ - 2.4.1
10
+ env:
11
+ global:
12
+ secure: lZ13zDiPIfKv6kd+dw93+UBgR+V5dEiwfcFOmPqhTbcdZKbBFYx7MX5l3pc3+T3W91O7To2xz+73f85OzDTyQn41HY6qrolwgQh/Pqo+8gbXu+eTN13qkUtr1RxLw0Qk+O697q85T1mM3GQd2IR5fdsyB3E56Z4Y2+NsA0YAXu7tuxGRsRgHg4B96/GxdLIKzF99TwqrZhxRncGgz76x7hN81K0kfRRKKWSx3fqXWdhM0KOZzxPbeyTaB46di2QHgyal5RqzqgFD0aWQ/wMxlkKebzajsG2ArHOccgH+2thXlMdRV6hjV9cEtNnAaTi2DypFbshoMTNN4Uox7L4kFlGXrikEownl8T66XYc05cdKiy8ekbhV0M7pKNcVSD7mwn68XZpqPsECpAI0QMgYTwGYN2DWdLVUBudYSFBhBkN7D7/HIdpN+s/Sszl5fpvZNnclVcZE/6s0X+2uDf6jurqm+Bel+e58JUm4KfWFVyMLM6NA7rq+zfOXzPOAivOTd9651o4w2Rot3GiuvnmNdS4rndaVpXdF4NT1/SHVDcJ5faqbaZ0/9498zUv8ylesOOnL0QUWG58xd6bsFYlgTfwR3TDlm6xFBsUvnxZhv3Lz0G/L4XRW1H2q6P/QfGt4JOje40+zUoCtjtI21MQcj19Lx1r5Vr6Fnf/aD6vdJDs=
13
+ cache: bundler
14
+ script: bundle install && bundle exec rspec spec/
15
+ deploy:
16
+ - provider: rubygems
17
+ api_key: "$GEM_TOKEN"
18
+ gem: kontena-plugin-app-command
19
+ on:
20
+ tags: true
21
+ rvm: 2.4.1
data/Dockerfile ADDED
@@ -0,0 +1,19 @@
1
+ FROM alpine:3.5
2
+ MAINTAINER Kontena, Inc. <info@kontena.io>
3
+
4
+ RUN apk update && apk --update add tzdata ruby ruby-irb ruby-rdoc ruby-bigdecimal \
5
+ ruby-io-console ruby-json ca-certificates libssl1.0 openssl libstdc++
6
+
7
+ ARG CLI_VERSION
8
+ ADD . /app/build
9
+ RUN apk --update add --virtual build-dependencies ruby-dev build-base && \
10
+ gem install bundler --no-ri --no-rdoc && \
11
+ cd /app/build && \
12
+ gem build kontena-plugin-app-command.gemspec && \
13
+ gem install --no-ri --no-rdoc kontena-plugin-aws kontena-plugin-shell && \
14
+ gem install --no-ri --no-rdoc `ls -t kontena-plugin-app-command*.gem|head -1` && \
15
+ rm -rf /app/build && \
16
+ apk del build-dependencies
17
+
18
+ WORKDIR /app
19
+ ENTRYPOINT kosh
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in kontena-plugin-api_command.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2015 Kontena, Inc.
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,299 @@
1
+ # Kontena APP subcommand plugin
2
+
3
+ This plugin adds back the "app" subcommand to kontena-cli which was removed in Kontena CLI V1.4.
4
+
5
+ ## Installation
6
+
7
+ `kontena plugin install app-command`
8
+
9
+ ## Usage
10
+
11
+ > Applications has been superceded by Stacks.
12
+
13
+ Any kind of application can be easily deployed to Kontena using the Kontena `app` commands. With these commands, you can use Kontena like any regular PaaS platform. One of the most interesting features of Kontena is the ability to import projects from other common PaaS platforms.
14
+
15
+ Kontena app commands include:
16
+
17
+ * `kontena app init` - Initialize Application; Import from existing PaaS project
18
+ * `kontena app deploy` - Deploy Application
19
+ * `kontena app start` - Start Application
20
+ * `kontena app stop` - Stop Application
21
+ * `kontena app rm` - Remove Application
22
+ * `kontena app ps` - List Application Services
23
+ * `kontena app logs` - Display Application Logs
24
+ * `kontena app monitor` - Monitor Application Service Instances
25
+ * `kontena app show` - Display Application Service Details
26
+
27
+ ## Initializing Application
28
+
29
+ The `kontena app init` command may be used to prepare your application to be run in Kontena. It will:
30
+
31
+ * Create a `Dockerfile` file for your project if not already exists.
32
+ * Create a `docker-compose.yml` file for your project if not already exists.
33
+ * Create a `kontena.yml` file for your project if not already exists.
34
+
35
+ The initialization will generate `Dockerfile`, `docker-compose.yml` and `kontena.yml` files automatically by inspecting the directory where the `kontena app init` command is executed. In the event that this directory contains files used by the [Heroku](https://www.heroku.com) PaaS platform, Kontena will automatically import Heroku settings.
36
+
37
+ ### Importing Heroku PaaS Platform Projects
38
+
39
+ Heroku is one of the most widely used PaaS platform out there. Heroku projects are described with `app.json` and `Procfile` files located in the root of the project directory. When Kontena detects these files, it generates corresponding services, add-ons and environment variables for docker-compose.yml and kontena.yml. The functionality is very similar to Heroku's [Build and Deploy with Docker](https://devcenter.heroku.com/articles/docker)
40
+
41
+ **Example**
42
+
43
+ Given the following files:
44
+
45
+ **app.json**
46
+
47
+ ```json
48
+ {
49
+ "name": "Small Sharp Tool",
50
+ "description": "This app does one little thing, and does it well.",
51
+ "env": {
52
+ "SECRET_TOKEN": {
53
+ "description": "A secret key for verifying the integrity of signed cookies.",
54
+ "generator": "secret"
55
+ },
56
+ "WEB_CONCURRENCY": {
57
+ "description": "The number of processes to run.",
58
+ "value": "5"
59
+ }
60
+ },
61
+ "addons": ["heroku-redis","mongolab:shared-single-small"]
62
+ }
63
+ ```
64
+
65
+ **Procfile**
66
+
67
+ ```
68
+ web: rackup -p $PORT -E production
69
+ worker: RACK_ENV=production ruby ./worker.rb run
70
+ ```
71
+
72
+ The command `kontena app init` will produce:
73
+
74
+ **docker-compose.yml**
75
+
76
+ ```yaml
77
+ web:
78
+ build: "."
79
+ command: "/start web"
80
+ env_file: ".env"
81
+ links:
82
+ - redis:redis
83
+ - mongolab:mongolab
84
+ environment:
85
+ - REDIS_URL=redis://redis:6379
86
+ - MONGOLAB_URI=mongolab:27017
87
+ redis:
88
+ image: redis:latest
89
+ mongolab:
90
+ image: mongo:latest
91
+ worker:
92
+ build: "."
93
+ command: "/start worker"
94
+ env_file: ".env"
95
+ links:
96
+ - redis:redis
97
+ - mongolab:mongolab
98
+ environment:
99
+ - REDIS_URL=redis://redis:6379
100
+ - MONGOLAB_URI=mongolab:27017
101
+ ```
102
+
103
+ **.env**
104
+
105
+ ```
106
+ SECRET_TOKEN=41977498daabf8b0f0ffbae63ce8bb4cd137b4a5f89d28248abe27e49724da274794e6bcc7df60a2b2c54ecaf16487830eb6c65e1fcf5aabc6f9cab8d3e34d83
107
+ WEB_CONCURRENCY=5
108
+ ```
109
+
110
+ **kontena.yml**
111
+
112
+ ```yaml
113
+ ---
114
+ web:
115
+ extends:
116
+ file: docker-compose.yml
117
+ service: web
118
+ image: registry.kontena.local/docker-twitter-stream:latest
119
+ redis:
120
+ extends:
121
+ file: docker-compose.yml
122
+ service: heroku-redis
123
+ mongolab:
124
+ extends:
125
+ file: docker-compose.yml
126
+ service: mongolab
127
+ worker:
128
+ extends:
129
+ file: docker-compose.yml
130
+ service: worker
131
+ image: registry.kontena.local/docker-twitter-stream:latest
132
+ ```
133
+
134
+ ## Deploying Application
135
+
136
+ Your application can be deployed to Kontena Nodes with a single command: `kontena app deploy`. The deploy process will look for the [kontena.yml](../references/kontena-yml.md) file (unless an alternative filename was specified), which is used to describe your application. Then, it will take care of everything needed to run your application. It will schedule services across your Nodes, pull required images, link services together, set environment variables, configure overlay networking, start the containers and more.
137
+
138
+ The usage of the `kontena app deploy` command is as follows:
139
+
140
+ ```
141
+ Usage:
142
+ kontena app deploy [OPTIONS] [SERVICE ...]
143
+
144
+ Options:
145
+ -f, --file FILE Specify an alternate kontena project file (default: kontena.yml)
146
+ -p, --project-name NAME Specify an alternate project name (default: directory name)
147
+ -h, --help print help
148
+ ```
149
+
150
+ **NOTE**: If you don't yet have the kontena.yml file in your project, you can get started with the `kontena app init` command.
151
+
152
+ ### Using Custom File to Describe Application
153
+
154
+ By default, Kontena will search for the `kontena.yml` file in the current directory. If you want to specify the path to a custom file, you can use the `-f` switch.
155
+
156
+ ```
157
+ $ kontena app deploy -f myapp.yml # application described in myapp.yml file
158
+ ```
159
+
160
+ ### Project Name
161
+
162
+ When an application is deployed, Kontena will prefix all service names with the name of your application. By default, Kontena uses the name of the current working directory. If you want to use a custom project name (prefix your application), you can do so via the `-p` switch.
163
+
164
+ ```
165
+ /foo/bar $ kontena app deploy # project name is bar, all services are prefixed "bar"
166
+ /foo/bar $ kontena app deploy -p app # project name is app, all services are prefixed "app"
167
+ ```
168
+
169
+ ### Deploying Partial Application
170
+
171
+ Sometimes you might want to deploy just some parts of your application. If that's the case, you can define the name of those specific services that you want deployed.
172
+
173
+ ```
174
+ $ kontena app deploy wordpress # only deploy services named "wordpress" and "lb"
175
+ ```
176
+
177
+ ### Example `kontena.yml`
178
+
179
+ Here's an example of a typical WordPress application described in `kontena.yml` file. See the complete kontena.yml reference [here](../references/kontena-yml.md).
180
+
181
+ ```yaml
182
+ wordpress:
183
+ image: wordpress:4.1
184
+ instances: 2
185
+ stateful: true
186
+ ports:
187
+ - 8080:80
188
+ links:
189
+ - mysql:wordpress-mysql
190
+ env_file: wordpress.env
191
+ deploy:
192
+ strategy: ha
193
+ wait_for_port: 80
194
+ mysql:
195
+ image: mariadb:5.5
196
+ stateful: true
197
+ environment:
198
+ - MYSQL_ROOT_PASSWORD=secret
199
+ ```
200
+
201
+ ## Stopping Application
202
+
203
+ The `kontena app stop` command stops running services without removing them.
204
+
205
+ ```
206
+ Usage:
207
+ kontena app stop [OPTIONS] [SERVICE] ...
208
+
209
+ Parameters:
210
+ [SERVICE] ... Services to stop
211
+
212
+ Options:
213
+ -f, --file FILE Specify an alternate Kontena compose file (default: "kontena.yml")
214
+ -p, --project-name NAME Specify an alternate project name (default: directory name)
215
+ -h, --help print help
216
+ ```
217
+
218
+ You can start services again with `kontena app start`
219
+
220
+ ## Starting Application
221
+
222
+ The `kontena app start` command starts existing services.
223
+
224
+ ```
225
+ Usage:
226
+ kontena app start [OPTIONS] [SERVICE] ...
227
+
228
+ Parameters:
229
+ [SERVICE] ... Services to start
230
+
231
+ Options:
232
+ -f, --file FILE Specify an alternate Kontena compose file (default: "kontena.yml")
233
+ -p, --project-name NAME Specify an alternate project name (default: directory name)
234
+ -h, --help print help
235
+ ```
236
+
237
+ ## Remove Application
238
+
239
+ You can remove an application's services with `kontena app rm`.
240
+
241
+ ```
242
+ Usage:
243
+ kontena app rm [OPTIONS] [SERVICE] ...
244
+
245
+ Parameters:
246
+ [SERVICE] ... Remove services
247
+
248
+ Options:
249
+ -f, --file FILE Specify an alternate Kontena compose file (default: "kontena.yml")
250
+ -p, --project-name NAME Specify an alternate project name (default: directory name)
251
+ -h, --help print help
252
+ ```
253
+
254
+ ## List Services of Application
255
+
256
+ `kontena app ps` lists and displays details about services
257
+
258
+ ```
259
+ Usage:
260
+ kontena app ps [OPTIONS] [SERVICE] ...
261
+
262
+ Parameters:
263
+ [SERVICE] ... Services to start
264
+
265
+ Options:
266
+ -f, --file FILE Specify an alternate Kontena compose file (default: "kontena.yml")
267
+ -p, --project-name NAME Specify an alternate project name (default: directory name)
268
+ -h, --help print help
269
+ ```
270
+
271
+ ## Display Application Logs
272
+
273
+ `kontena app logs` displays combined log entries from services.
274
+
275
+ ```
276
+ Usage:
277
+ kontena app logs [OPTIONS] [SERVICE] ...
278
+
279
+ Parameters:
280
+ [SERVICE] ... Services to start
281
+
282
+ Options:
283
+ -f, --file FILE Specify an alternate Kontena compose file (default: "kontena.yml")
284
+ -p, --project-name NAME Specify an alternate project name (default: directory name)
285
+ -h, --help print help
286
+ ```
287
+
288
+
289
+ ## Contributing
290
+
291
+ 1. Fork it ( https://github.com/kontena/kontena-plugin-app-command )
292
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
293
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
294
+ 4. Push to the branch (`git push origin my-new-feature`)
295
+ 5. Create a new Pull Request
296
+
297
+ ## License
298
+
299
+ Kontena is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE.txt) for full license text.