Skip to content

fix: take down running containers before building #652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion api/oracle-cloud/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ console.log(String(logs));

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

console.log("⤴️ Uploading new code ...");
logs = execSync(
Expand All @@ -76,7 +78,14 @@ logs = execSync(
":" +
appPath,
);
console.log("✅ New code uploaded.");
console.log(String(logs));

// note-zm: we must take down the containers before starting them up, our weak VPS can not handle
// the load of running containers and building new ones at the same time
// todo-zm: build images in CI and push to private Github registry, so our VPS will only pull the images
console.log("⚙️ Taking down running containers ...");
logs = execSync(sshPrefix + '"cd ' + appPath + ' && docker compose down --remove-orphans"');
console.log(String(logs));

console.log("\n⚙️ Starting up the app");
logs = execSync(
Expand Down
2 changes: 1 addition & 1 deletion api/src/bitbucket/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export interface BitbucketUser {
username?: string;
display_name: string;
nickname?: string;
links: { avatar: { href: "https://bitbucket.org/account/open-listings/avatar/" } };
links: { avatar: { href: string } };
type: "user" | "team";
}

Expand Down
Loading