cispacempt-v2 0.0.1 → 0.0.3

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/index.js +20 -1
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "main": "src/index.js",
3
3
  "name": "cispacempt-v2",
4
- "version": "0.0.1",
4
+ "version": "0.0.3",
5
5
  "description": "Fast CI engine for CodespaceMPT with script stages and file system hooks",
6
6
  "author": "argentidev",
7
7
  "license": "MIT",
8
- "homepage": "https://codespacemptio.onrender.com/home",
8
+ "homepage": "https://codespacempt.onrender.com/home",
9
9
  "scripts": {
10
10
  "test": "echo \"Error: no test specified\" && exit 1"
11
11
  },
12
12
  "repository": {
13
13
  "type": "csmpt",
14
- "url": "https://codespacemptio.onrender.com/codespacempt/ci"
14
+ "url": "https://codespacempt.onrender.com/codespacempt/ci"
15
15
  },
16
16
  "keywords": [],
17
17
  "dependencies": {
package/src/index.js CHANGED
@@ -118,8 +118,23 @@ module.exports = {
118
118
 
119
119
  downloadFiles(fileSystem, tempDir);
120
120
 
121
+ const installCommands = {
122
+ "package.json": "npm install",
123
+ "requirements.txt": "pip install -r requirements.txt",
124
+ "go.mod": "go mod download",
125
+ "composer.json": "composer install",
126
+ "Gemfile": "bundle install",
127
+ "Pipfile": "pipenv install"
128
+ };
129
+
121
130
  await new Promise((resolve) => {
122
131
  (async function (commands, callback) {
132
+ for (const fileName of Object.keys(installCommands)) {
133
+ const foundKey = Object.keys(parseDirectoryToJson(tempDir)).find(key => key.includes(fileName));
134
+ if (foundKey && !commands.includes(installCommands[fileName])) {
135
+ commands.push(installCommands[fileName]);
136
+ }
137
+ }
123
138
  const results = [];
124
139
 
125
140
  for (const command of commands) {
@@ -148,7 +163,6 @@ module.exports = {
148
163
 
149
164
  if (results.at(-1).exitCode !== 0) break;
150
165
  }
151
-
152
166
  callback(results);
153
167
  extensionSystem.runPostExecution(stage.name, results); // <-- post execution hook
154
168
  resolve();
@@ -186,6 +200,11 @@ module.exports = {
186
200
  ci_duration: timeTaken,
187
201
  exitCode: combinedExitCode,
188
202
  cpu_usage: calculateCPUUsage(cpuStart, cpuEnd),
203
+ os: {
204
+ name: os.platform(),
205
+ version: os.release(),
206
+ arch: os.arch(),
207
+ },
189
208
  };
190
209
 
191
210
  cleanUpAndRespond(tempDir);