From ec84b9ab1d079891f107c3b195f5ecb42d5255ba Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Mon, 18 Mar 2019 22:55:46 +0200 Subject: [PATCH] CI: preparation for setting up scheduled APT repository cleanup Scan repository for old package versions and remove them to free used space. --- .gitlab-ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 820abdf8a..0b36fe772 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,8 @@ stages: ## prevent leaking of sensitive information. .job_template: &build_job stage: build + except: + - schedules script: - unset BINTRAY_USERNAME - unset BINTRAY_API_KEY @@ -57,6 +59,8 @@ upload-packages: stage: deploy only: - master@termux-mirror/termux-packages + except: + - schedules script: - MODIFIED_PACKAGES=$(./scripts/build/ci/determine_git_changes.sh) - | @@ -70,3 +74,16 @@ upload-packages: when: - runner_system_failure - unknown_failure + +## Remove old versions from the APT repository. +repository-cleanup: + stage: deploy + only: + - schedules + script: + - ./scripts/package_uploader.sh --cleanup $(cd ./packages; echo *) + retry: + max: 2 + when: + - runner_system_failure + - unknown_failure