Skip to content

Commit df072fc

Browse files
committed
feat: add cleanup for old Docker images and containers in deployment script
1 parent 3becfc6 commit df072fc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

api/oracle-cloud/deploy.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ const appPath = "~/app";
5252
const sshPrefix =
5353
"ssh -o StrictHostKeyChecking=no " + (sshKeyPath ? `-i ${sshKeyPath} ` : "") + sshServer + " ";
5454

55+
console.log("⚠️ Cleaning up old images ...");
56+
logs = execSync(sshPrefix + '"sudo docker image prune --force"');
57+
console.log(String(logs));
58+
console.log("⚠️ Cleaning up old containers ...");
59+
logs = execSync(sshPrefix + '"sudo docker container prune --force"');
60+
console.log(String(logs));
61+
5562
console.log("⚠️ Deleting old code ...");
5663
logs = execSync(sshPrefix + '"rm -f -r ' + appPath + '"');
5764
logs = execSync(sshPrefix + '"mkdir ' + appPath + '"');

0 commit comments

Comments
 (0)