Skip to content

Commit

Permalink
fix: reorder cleanup logs for old Docker images and containers in dep…
Browse files Browse the repository at this point in the history
…loyment script
  • Loading branch information
ZibanPirate committed Feb 6, 2025
1 parent d37fa5e commit deec340
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/oracle-cloud/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ const appPath = "~/app";
const sshPrefix =
"ssh -o StrictHostKeyChecking=no " + (sshKeyPath ? `-i ${sshKeyPath} ` : "") + sshServer + " ";

console.log("⚠️ Cleaning up old images ...");
logs = execSync(sshPrefix + '"sudo docker image prune --force"');
console.log(String(logs));
console.log("⚠️ Cleaning up old containers ...");
logs = execSync(sshPrefix + '"sudo docker container prune --force"');
console.log(String(logs));

console.log("⚠️ Cleaning up old images ...");
logs = execSync(sshPrefix + '"sudo docker image prune --force"');
console.log(String(logs));

console.log("⚠️ Deleting old code ...");
logs = execSync(sshPrefix + '"rm -f -r ' + appPath + '"');
logs = execSync(sshPrefix + '"mkdir ' + appPath + '"');
Expand Down

0 comments on commit deec340

Please sign in to comment.