jarvis-ci 1.0.3 → 1.0.5

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
@@ -59,7 +59,8 @@ const ALLOWED_COMMANDS = [
59
59
  "docker",
60
60
  "docker-compose",
61
61
  "ssh",
62
- "git"
62
+ "git",
63
+ "cd"
63
64
  ];
64
65
  ```
65
66
 
@@ -3,29 +3,22 @@
3
3
  "port": 5050,
4
4
  "local": false,
5
5
  "proxy": "",
6
- "secret": "6e23a467d3acbf3adb29979f1757876d"
6
+ "secret": "8f07975bf54ae7330ca4e07d39d67209"
7
7
  },
8
8
  "repos": [
9
9
  {
10
- "name": "backend",
10
+ "name": "test",
11
11
  "repo": "asdf/sdf",
12
12
  "branch": "main",
13
- "yamlPath": "/home/muqeet-ahmad/Desktop/jarvis-ci/pipelines/backend/backend.jarvis.yaml",
13
+ "yamlPath": "/home/muqeet-ahmad/Desktop/jarvis-ci/pipelines/test/test.jarvis.yaml",
14
14
  "tempDir": "/home/muqeet-ahmad/Desktop/jarvis-ci/tmp/asdf-sdf"
15
15
  },
16
16
  {
17
- "name": "n",
18
- "repo": "sdf/sdf",
17
+ "name": "asdfsadf",
18
+ "repo": "sdf/asdf",
19
19
  "branch": "main",
20
- "yamlPath": "/home/muqeet-ahmad/Desktop/jarvis-ci/pipelines/n/n.jarvis.yaml",
21
- "tempDir": "/home/muqeet-ahmad/Desktop/jarvis-ci/tmp/sdf-sdf"
22
- },
23
- {
24
- "name": "asdf",
25
- "repo": "sd/d",
26
- "branch": "main",
27
- "yamlPath": "/home/muqeet-ahmad/Desktop/jarvis-ci/pipelines/asdf/asdf.jarvis.yaml",
28
- "tempDir": "/home/muqeet-ahmad/Desktop/jarvis-ci/tmp/sd-d"
20
+ "yamlPath": "/home/muqeet-ahmad/Desktop/jarvis-ci/pipelines/asdfsadf/asdfsadf.jarvis.yaml",
21
+ "tempDir": "/home/muqeet-ahmad/Desktop/jarvis-ci/tmp/sdf-asdf"
29
22
  }
30
23
  ]
31
24
  }
@@ -34,8 +34,9 @@ export class ConfigCommand {
34
34
  };
35
35
  const configFile = fs.readFileSync(this.CONFIG_PATH);
36
36
  let configArray = JSON.parse(configFile.toString());
37
- const webhookSecret = configArray.server.secret !== "" ? configArray.server.secret : crypto.randomBytes(16).toString('hex');
38
- if (configArray.server.secret !== "") {
37
+ if (configArray.server.secret === "") {
38
+ console.log("jhere we are");
39
+ const webhookSecret = crypto.randomBytes(16).toString('hex');
39
40
  configArray.server.secret = webhookSecret;
40
41
  }
41
42
  configArray.server.local = local;
@@ -45,7 +46,7 @@ export class ConfigCommand {
45
46
  configArray.repos.push(config);
46
47
  fs.writeFileSync(this.CONFIG_PATH, JSON.stringify(configArray, null, 2));
47
48
  console.info(`
48
- The webhook secret is this: ${webhookSecret}
49
+ The webhook secret is this: ${configArray.server.secret}
49
50
  `);
50
51
  console.log('✅ configuration has been added successfully to .jarvis-ci.json');
51
52
  }
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.3",
3
+ "version": "1.0.5",
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 @@
1
+ adf
@@ -0,0 +1 @@
1
+ asdf