Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
M MTSA
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 35
    • Issues 35
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Metrics
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • lafhis
  • MTSA
  • Merge requests
  • !20

Merged
Created Nov 01, 2026 by Sebastian Uchitel@suchitelOwner1 of 2 tasks completed1/2 tasks

Delete old builds from the server when deploying a new one

  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 1

Summary

  • The copy-artifact job copied a new timestamped mtsa-build.<timestamp>.jar to /var/www/mtsa/download/builds/ on every master pipeline and never removed old ones, so the server was filling up.
  • After copying the new jar and updating the mtsa-latest-build.jar symlink, the job now deletes all but the KEEP_BUILDS most recent builds (set to 5 in the job's variables).
  • The just-copied jar is always the newest, so it is never deleted, and the mtsa-latest-build.jar symlink doesn't match the mtsa-build.*.jar pattern, so it isn't touched.
  • Tagged releases in /var/www/mtsa/download/releases/ are not affected.

Note: the first master pipeline after this merges will delete every build except the 5 newest. Links to older timestamped builds will stop working.

Test plan

  • YAML parses; the cleanup command was run against 14 dummy build files: it removed the oldest, kept the newest, and left the symlink working.
  • After merging, check the copy-artifact job log for "Removing ..." lines and confirm /var/www/mtsa/download/builds/ holds 5 builds plus mtsa-latest-build.jar.

🤖 Generated with Claude Code

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: feature/prune-old-builds