@omer-x/buttler 0.1.3 → 0.1.4
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 +0 -3
- package/bin/cli.js +8 -4
- package/bin/git.js +11 -11
- package/package.json +3 -4
package/README.md
CHANGED
package/bin/cli.js
CHANGED
|
@@ -30,13 +30,16 @@ function spawnChildProcess(detached) {
|
|
|
30
30
|
child.unref();
|
|
31
31
|
return child.pid;
|
|
32
32
|
}
|
|
33
|
-
async function start() {
|
|
33
|
+
async function start(development) {
|
|
34
|
+
if (development) {
|
|
35
|
+
await stop();
|
|
36
|
+
}
|
|
34
37
|
const pidFilePath = resolve(process.cwd(), "PID");
|
|
35
38
|
const exists = await checkFile(pidFilePath);
|
|
36
39
|
if (exists) {
|
|
37
40
|
return console.warn("the application is already running");
|
|
38
41
|
}
|
|
39
|
-
const pid = spawnChildProcess(
|
|
42
|
+
const pid = spawnChildProcess(!development);
|
|
40
43
|
await fs.writeFile(pidFilePath, `${pid}`, "utf8");
|
|
41
44
|
console.log("the application has started");
|
|
42
45
|
}
|
|
@@ -63,10 +66,11 @@ async function stop() {
|
|
|
63
66
|
}
|
|
64
67
|
async function restart() {
|
|
65
68
|
await stop();
|
|
66
|
-
await start();
|
|
69
|
+
await start(false);
|
|
67
70
|
}
|
|
68
71
|
const program = new Command();
|
|
69
|
-
program.command("
|
|
72
|
+
program.command("dev").description("starts the application").action(() => start(true));
|
|
73
|
+
program.command("start").description("starts the application").action(() => start(false));
|
|
70
74
|
program.command("stop").description("stops the application").action(stop);
|
|
71
75
|
program.command("restart").description("restarts the application").action(restart);
|
|
72
76
|
program.parse(process.argv);
|
package/bin/git.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
export function cloneRepo(repoUrl, targetPath) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import simpleGit from "simple-git";
|
|
2
|
+
export async function cloneRepo(repoUrl, targetPath) {
|
|
3
|
+
const git = simpleGit({
|
|
4
|
+
baseDir: targetPath,
|
|
5
|
+
binary: "git",
|
|
6
|
+
maxConcurrentProcesses: 6,
|
|
7
|
+
});
|
|
8
|
+
await git.clone(repoUrl, targetPath, {
|
|
9
|
+
"--depth": "1",
|
|
10
|
+
"--single-branch": null,
|
|
11
|
+
"--branch": "main",
|
|
12
12
|
});
|
|
13
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omer-x/buttler",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "automates CI/CD workflows using Docker and GitHub webhooks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
],
|
|
39
39
|
"type": "module",
|
|
40
40
|
"engines": {
|
|
41
|
-
"node": "
|
|
41
|
+
"node": ">=19.0.0"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dockerode": "^4.0.2",
|
|
52
52
|
"dotenv": "^16.4.5",
|
|
53
53
|
"express": "^4.19.2",
|
|
54
|
-
"
|
|
54
|
+
"simple-git": "^3.25.0",
|
|
55
55
|
"tar-fs": "^3.0.6"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
@@ -59,7 +59,6 @@
|
|
|
59
59
|
"@types/dockerode": "^3.3.31",
|
|
60
60
|
"@types/express": "^4.17.21",
|
|
61
61
|
"@types/node": "^22.0.0",
|
|
62
|
-
"@types/nodegit": "^0.28.7",
|
|
63
62
|
"@types/tar-fs": "^2.0.4",
|
|
64
63
|
"eslint": "^8.57.0",
|
|
65
64
|
"ts-unused-exports": "^10.1.0",
|