@eliware/vyops 1.0.4 → 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/RELEASE_NOTES.md +12 -0
- package/package.json +1 -1
- package/src/deploy.mjs +5 -0
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Release Notes
|
|
2
2
|
|
|
3
|
+
## 1.0.5
|
|
4
|
+
|
|
5
|
+
- Create nested temporary directories before uploading synchronized scripts.
|
|
6
|
+
- Fix deployment of nested files such as systemd units and boot scripts.
|
|
7
|
+
|
|
8
|
+
Verification:
|
|
9
|
+
|
|
10
|
+
- `npm test`
|
|
11
|
+
- `npm run lint`
|
|
12
|
+
- `npm run audit`
|
|
13
|
+
- `npm run validate:package`
|
|
14
|
+
|
|
3
15
|
## 1.0.4
|
|
4
16
|
|
|
5
17
|
- Synchronize the complete repository `scripts/` tree to `/config/scripts`.
|
package/package.json
CHANGED
package/src/deploy.mjs
CHANGED
|
@@ -53,6 +53,11 @@ async function installScripts(client, config, log, runId) {
|
|
|
53
53
|
const mode = (await fs.promises.stat(local)).mode & 0o777;
|
|
54
54
|
const backedUp = await exec(client, `if sudo test -e ${JSON.stringify(installed)}; then sudo mkdir -p ${JSON.stringify(`${backupDir}/${parent}`)} && sudo cp -p -- ${JSON.stringify(installed)} ${JSON.stringify(backup)}; fi`);
|
|
55
55
|
if (backedUp.code !== 0) throw new Error(`script backup failed (${name}): ${backedUp.stderr || backedUp.stdout}`.trim());
|
|
56
|
+
if (parent !== '.') {
|
|
57
|
+
const remoteParent = `${remoteDir}/${parent}`;
|
|
58
|
+
const remoteParentResult = await exec(client, `mkdir -p ${JSON.stringify(remoteParent)}`);
|
|
59
|
+
if (remoteParentResult.code !== 0) throw new Error(`script upload directory setup failed (${name}): ${remoteParentResult.stderr || remoteParentResult.stdout}`.trim());
|
|
60
|
+
}
|
|
56
61
|
await upload(client, local, remote);
|
|
57
62
|
const installedResult = await exec(client, `sudo mkdir -p ${JSON.stringify(`${installDir}/${parent}`)} && sudo install -m ${mode.toString(8)} ${JSON.stringify(remote)} ${JSON.stringify(installed)}`);
|
|
58
63
|
if (installedResult.code !== 0) throw new Error(`script install failed (${name}): ${installedResult.stderr || installedResult.stdout}`.trim());
|