22
33## Installation
44
5- ``` bash
6- npm install @jrmc/catapult
7- ```
8-
9- Once installed, the ` cata ` CLI is available:
5+ Run the following command at the root of your project:
106
117``` bash
12- cata deploy
8+ npx @jrmc/catapult init
139```
1410
15- ## Usage
16-
17- Generate a ` deploy.ts ` file at the root of your project:
11+ This creates a ` deploy.ts ` configuration file and installs ` @jrmc/catapult ` as a dev dependency. Once installed, the ` cata ` CLI is available:
1812
1913``` bash
20- cata init
14+ npx cata deploy
2115```
2216
23- Or create it manually:
17+ ## Configuration
18+
19+ Edit the generated ` deploy.ts ` file, or create it manually:
2420
2521``` typescript
2622import { defineConfig } from ' @jrmc/catapult'
@@ -39,7 +35,10 @@ await defineConfig({
3935 name: ' staging' ,
4036 ssh: ' deploy@staging.example.com' ,
4137 deployPath: ' /home/deploy/staging/myapp' ,
42- branch: ' develop' ,
38+ branch: {
39+ name: ' develop' ,
40+ ask: true ,
41+ },
4342 healthcheckUrl: ' http://127.0.0.1:3333/health' ,
4443 },
4544 {
@@ -59,37 +58,37 @@ await defineConfig({
5958
6059``` bash
6160# Show the current version
62- cata version
61+ npx cata version
6362
6463# Create a deploy.ts configuration file
65- cata init
66-
67- # Deploy
68- cata deploy
64+ npx cata init
6965
7066# Initial server setup (create directories)
71- cata deploy:setup
67+ npx cata deploy:setup
68+
69+ # Deploy
70+ npx cata deploy
7271
7372# Rollback to the previous release
74- cata rollback
73+ npx cata rollback
7574
7675# Server status
77- cata status
76+ npx cata status
7877
7978# List releases
80- cata list:releases
79+ npx cata list:releases
8180
8281# List registered tasks and the current pipeline
83- cata list:tasks
82+ npx cata list:tasks
8483
8584# Run a specific task on servers
86- cata task < task-name>
85+ npx cata task < task-name>
8786
8887# Target a specific host
89- cata deploy --host staging
88+ npx cata deploy --host staging
9089
9190# Override the branch to deploy
92- cata deploy --branch feature/my-feature
91+ npx cata deploy --branch feature/my-feature
9392```
9493
9594## Branch
@@ -125,7 +124,7 @@ hosts: [
125124You can also override the branch for all hosts at deploy time:
126125
127126``` bash
128- cata deploy --branch feature/my-feature
127+ npx cata deploy --branch feature/my-feature
129128```
130129
131130## Server structure
@@ -171,7 +170,7 @@ hosts: [
171170Deployment runs sequentially on each host. To target a single host:
172171
173172``` bash
174- cata deploy --host staging
173+ npx cata deploy --host staging
175174```
176175
177176## Automatic rollback
0 commit comments