jarvis-ci 1.0.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -60,7 +60,6 @@ const ALLOWED_COMMANDS = [
60
60
  "docker-compose",
61
61
  "ssh",
62
62
  "git",
63
- "cd"
64
63
  ];
65
64
  ```
66
65
 
@@ -74,12 +73,15 @@ Each repository defines its pipeline using a `.jarvis.yml` file.
74
73
 
75
74
  Example configuration:
76
75
 
76
+ by default the cwd is /home/user/tmp/<pipeline configuration name by jarvis> else if user wants to change the working directory for some operation
77
+
77
78
  ```yaml
78
79
  steps:
79
80
  - name: Install dependencies
80
81
  run:
81
82
  cmd: npm
82
83
  args: ["install"]
84
+ cwd: "/path" (optional)
83
85
 
84
86
  - name: Run tests
85
87
  run:
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "server": {
3
3
  "port": 5050,
4
- "local": false,
5
- "proxy": "",
4
+ "local": true,
5
+ "proxy": "https://smee.io/44BoIP63cfQYsxE",
6
6
  "secret": "8f07975bf54ae7330ca4e07d39d67209"
7
7
  },
8
8
  "repos": [
@@ -19,6 +19,13 @@
19
19
  "branch": "main",
20
20
  "yamlPath": "/home/muqeet-ahmad/Desktop/jarvis-ci/pipelines/asdfsadf/asdfsadf.jarvis.yaml",
21
21
  "tempDir": "/home/muqeet-ahmad/Desktop/jarvis-ci/tmp/sdf-asdf"
22
+ },
23
+ {
24
+ "name": "test-again",
25
+ "repo": "engrmuqeetahmad/test-jarvis-ci-repo",
26
+ "branch": "main",
27
+ "yamlPath": "/home/muqeet-ahmad/Desktop/jarvis-ci/pipelines/test-again/test-again.jarvis.yaml",
28
+ "tempDir": "/home/muqeet-ahmad/Desktop/jarvis-ci/tmp/engrmuqeetahmad-test-jarvis-ci-repo"
22
29
  }
23
30
  ]
24
31
  }
@@ -13,7 +13,6 @@ export class PipelineCommand {
13
13
  "docker-compose",
14
14
  "ssh",
15
15
  "git",
16
- "cd",
17
16
  ];
18
17
  configService;
19
18
  CONFIG_PATH = path.join(process.cwd(), 'configs', '.jarvis-ci.json');
@@ -73,12 +72,12 @@ export class PipelineCommand {
73
72
  }
74
73
  }
75
74
  }
76
- createTasks(config, cwd) {
75
+ createTasks(config, defaultCWD) {
77
76
  return new Listr(config.steps.map((step) => ({
78
77
  title: step.name,
79
78
  task: async () => {
80
79
  await execa(step.run.cmd, step.run.args, {
81
- cwd,
80
+ cwd: step.run.cwd ? step.run.cwd : defaultCWD,
82
81
  stdio: "inherit",
83
82
  });
84
83
  },
package/dist/index.d.ts CHANGED
@@ -27,5 +27,6 @@ export type Step = {
27
27
  run: {
28
28
  cmd: string;
29
29
  args: string[];
30
+ cwd?: string;
30
31
  }
31
32
  }
package/dist/server.js CHANGED
@@ -9,7 +9,7 @@ export class Server {
9
9
  webhooks;
10
10
  configCommand;
11
11
  pipelineCommand;
12
- smee;
12
+ smee = null;
13
13
  configManager;
14
14
  constructor() {
15
15
  this.configManager = ConfigManager.getInstance();
@@ -25,7 +25,7 @@ export class Server {
25
25
  logger: console,
26
26
  });
27
27
  }
28
- else {
28
+ else if (this.configManager.getConfig().server.local && this.configManager.getConfig().server.proxy === "") {
29
29
  throw new Error("⚠️ Local server is enabled but no proxy URL is configured. Please set the proxy URL from https://smee.io to receive webhooks from GitHub.");
30
30
  }
31
31
  this.registerHandlers();
@@ -69,7 +69,7 @@ export class Server {
69
69
  }).listen(config.server.port, () => {
70
70
  console.log(`Server running on ${config.server.port}`);
71
71
  });
72
- if (this.configManager.getConfig().server.local && this.configManager.getConfig().server.proxy !== "") {
72
+ if (this.configManager.getConfig().server.local && this.configManager.getConfig().server.proxy !== "" && this.smee !== null) {
73
73
  this.smee.start();
74
74
  }
75
75
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jarvis-ci",
3
- "version": "1.0.4",
3
+ "version": "2.0.0",
4
4
  "description": "This npm package is light weight CI/CD tool. the goal is to achieve simplicity and local machine CI/CD execution. it is configured through YAML for commands.",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -0,0 +1,8 @@
1
+ steps:
2
+ - name: Command test cwd
3
+ run:
4
+ cmd: npm
5
+ args: ["init", "-y"]
6
+ cwd: "/home"
7
+
8
+
@@ -0,0 +1,18 @@
1
+ [2026-04-11T19:03:50.765Z] 🚀 Running pipeline
2
+ [2026-04-11T19:03:50.776Z] ❌ Pipeline failed: Nested mappings are not allowed in compact mappings at line 2, column 11:
3
+
4
+ - name: cd command test cwd
5
+ ^
6
+
7
+ [2026-04-11T19:05:07.051Z] 🚀 Running pipeline
8
+ [2026-04-11T19:05:07.061Z] ❌ Pipeline failed: Nested mappings are not allowed in compact mappings at line 2, column 11:
9
+
10
+ - name: command test cwd
11
+ ^
12
+
13
+ [2026-04-11T19:07:04.915Z] 🚀 Running pipeline
14
+ [2026-04-11T19:07:05.048Z] ✅ Pipeline finished
15
+ [2026-04-11T19:09:49.070Z] 🚀 Running pipeline
16
+ [2026-04-11T19:09:49.280Z] ❌ Pipeline failed: Command failed with exit code 1: npm 'init -y'
17
+ [2026-04-11T19:10:36.172Z] 🚀 Running pipeline
18
+ [2026-04-11T19:10:36.588Z] ❌ Pipeline failed: Command failed with exit code 243: npm init -y