Skip to content
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

Remove more than X old releases in Baremetal deploy #5359

Closed
wants to merge 8 commits into from

Conversation

cannikin
Copy link
Member

@cannikin cannikin commented Apr 29, 2022

This adds a step at the end of a Baremetal deploy that will remove a number of old releases, keeping a configurable number still on the server (for rollbacks).

This code is branched from #5349 and assumes it will be merged first!

Closes #5298

Release Notes

Baremetal will now cleanup old deploy codebase directories at the end of a deployment! It defaults to keep the last 5 deployments, but this can be configured in deploy.toml with the keepReleases option:

[[servers.production]]
host = "server.com"
username = "ubuntu"
agentForward = true
sides = ["api", "web"]
path = "/var/www/myapp"
processNames = ["api"]
repo = "git@github.com:myorg/myrepo.git"
branch = "main"
+ keepReleases = 5

Why keep around old deploys? In case something goes horribly wrong and you need to rollback!

This config setting is optional and will default to keeping the last 5 deploys if not set.

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@cannikin cannikin mentioned this pull request May 10, 2022
@cannikin
Copy link
Member Author

Consolidated in #5500

@cannikin cannikin closed this May 11, 2022
@cannikin cannikin deleted the rc-baremetal-cleanup branch May 28, 2022 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:feature This PR introduces a new feature topic/deployment
Projects
Status: Archived
Development

Successfully merging this pull request may close these issues.

None yet

1 participant