UNPKG

3.06 kBMarkdownView Raw
1![Capitana: a build tool for microservices](cover.png)
2
3[![install size](https://flat.badgen.net/packagephobia/install/capitana)](https://packagephobia.now.sh/result?p=capitana) [![npm version](https://flat.badgen.net/npm/v/capitana)](https://www.npmjs.com/package/capitana) [![XO code style](https://flat.badgen.net/xo/status/capitana)](https://github.com/xojs/xo)
4
5Microservice architecture has its perks, and orchestration systems sure do help to alleviate its pitfalls. Sooner or later, though, developers end up with a bunch of scripts to manage all the steps required to deploy your architecture.
6
7With `capitana`, you'll be able to control all the things your orchestration system can't quite reach.
8
9Forget about
10
11```bash
12./build-database-prod.sh
13./build-api-prod.sh
14./build-database-prod.sh
15```
16
17and start `capitana build --environment prod --all`!
18
19## Installation
20
21### Using [npm](https://github.com/npm/cli)
22
23```bash
24$ npm install --global capitana
25```
26
27### Using [npx](https://github.com/zkat/npx)
28
29```bash
30$ npx capitana [stage] [microservices] [options]
31```
32
33## Usage
34
35```bash
36$ capitana --help
37
38 Usage
39 capitana [stage] [microservices] [options]
40
41 Options
42 --all Execute program on all microservices.
43 --break Stop execution on execution failure.
44 --config filePath Specifies a different config file to use
45 --except microservices Exclude microservices from execution.
46 --full Executes all stages on the selected microservices.
47 --help Show this message and exit.
48 --interactive Executes capitana interactively.
49 --list [ "variables" | "microservices" | "stages"] List configured variables.
50 --listAllowed [ microservice | stage ] Lists the stages a microservice is allowed
51 to run through or the microservices allowed to run through a stage.
52 --no-spinner Disables spinner. Useful for non-unicode terminals.
53 --no-warnings Treats all stderr as an error and not a warning.
54 --verbose Execute program on all microservices.
55 Examples
56 $ capitana deploy --all
57 executes stage 'deploy' on all microservices
58 $ capitana --full database
59 executes all stages on microservice 'database'
60```
61
62## Configuration file
63
64Capitana is heavily dependant on its own `.capitanarc` configuration file. For the time being, the only way to mahe `capinana` respect this configuration file is to create it on the folder you're gonna be running `capitana` on.
65
66Example configuration file:
67
68```yaml
69microservices:
70 database: ~
71 load-balancer:
72 allowedStages:
73 - tag
74 - deploy
75 server: ~
76stages:
77 build:
78 run: npm run build
79 cwd: $MICROSERVICE
80 deploy:
81 run: kubernetes apply -f deployment-$environment-$tag.yaml
82 variables:
83 - environment
84 - tag
85 cwd: $MICROSERVICE
86 push:
87 run: docker-compose push
88 cwd: $MICROSERVICE
89variables:
90 environment:
91 - dev
92 - test
93 - prod
94 tag:
95 - latest
96 - "1.0"
97 defaults:
98 tag: "latest"
99```
100
101## License
102
103MIT © [LTS Beratung](https://lts-beratung.de/en.html)