@agent8/deploy 1.0.5 → 1.0.6
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/bin/agent8.js +17 -11
- package/package.json +1 -1
package/bin/agent8.js
CHANGED
|
@@ -12,7 +12,8 @@ const envFilePath = path.resolve(process.cwd(), ".env");
|
|
|
12
12
|
const deployedFilePath = path.resolve(process.cwd(), ".deployed");
|
|
13
13
|
|
|
14
14
|
if (!fs.existsSync(envFilePath)) {
|
|
15
|
-
|
|
15
|
+
console.error("Error: .env file does not exist");
|
|
16
|
+
process.exit(1);
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
// Load previously deployed file hashes
|
|
@@ -32,17 +33,22 @@ const endpoint =
|
|
|
32
33
|
envConfig.VITE_AGENT8_REMOTE_URL ||
|
|
33
34
|
"https://verse8-simple-game-backend-609824224664.asia-northeast3.run.app";
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
console.
|
|
36
|
+
const verse = envConfig.VITE_AGENT8_VERSE;
|
|
37
|
+
const account = envConfig.VITE_AGENT8_ACCOUNT;
|
|
38
|
+
const accessToken = process.env.V8_ACCESS_TOKEN;
|
|
39
|
+
|
|
40
|
+
// Check if required variables exist
|
|
41
|
+
if (!verse || !account || !accessToken) {
|
|
42
|
+
console.error("Error: Missing required deployment variables");
|
|
43
|
+
console.error("VITE_AGENT8_VERSE:", verse ? "✓" : "✗");
|
|
44
|
+
console.error("VITE_AGENT8_ACCOUNT:", account ? "✓" : "✗");
|
|
45
|
+
console.error("V8_ACCESS_TOKEN:", accessToken ? "✓" : "✗");
|
|
46
|
+
console.error("Please set all required variables before deploying");
|
|
47
|
+
process.exit(1);
|
|
43
48
|
}
|
|
44
49
|
|
|
45
50
|
console.log("Starting deployment to verse:", verse);
|
|
51
|
+
console.log("Account:", account);
|
|
46
52
|
|
|
47
53
|
// Files to upload
|
|
48
54
|
const filesToUpload = [];
|
|
@@ -130,10 +136,10 @@ const uploadPromises = filesToUpload.map((fileInfo) => {
|
|
|
130
136
|
form.append("path", uploadPath || "/");
|
|
131
137
|
|
|
132
138
|
return axios
|
|
133
|
-
.post(`${endpoint}/verses/${verse}/files`, form, {
|
|
139
|
+
.post(`${endpoint}/verses/${account}-${verse}/files`, form, {
|
|
134
140
|
headers: {
|
|
135
141
|
...form.getHeaders(),
|
|
136
|
-
"X-
|
|
142
|
+
"X-Access-Token": accessToken,
|
|
137
143
|
},
|
|
138
144
|
})
|
|
139
145
|
.then(() => {
|