From 97f569b5b4145e8d38c41f9af984f605aceaad32 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Wed, 8 Apr 2020 00:26:35 +0200 Subject: [PATCH] fix #22 - increasing repository storage due to CI --- .gitlab-ci.yml | 3 +++ setup/delete-gitlab-artifacts.sh | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 setup/delete-gitlab-artifacts.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 337b94af..43a3010b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,9 @@ pages: - cd docs - bash generate.sh artifacts: + # prevent storage increase + # in period of inactivity a weekly CRON regenerate the site + expire_in: 1 week paths: - public only: diff --git a/setup/delete-gitlab-artifacts.sh b/setup/delete-gitlab-artifacts.sh new file mode 100644 index 00000000..04abcfd8 --- /dev/null +++ b/setup/delete-gitlab-artifacts.sh @@ -0,0 +1,9 @@ +if [ -z "$PUB_DEXED_RLZ" ]; then + echo "no access token available to delete artifacts of job" $1 + exit 1 +fi + +export PUB_DEXED_RLZ="H_AUTBZCrxUsh-XYTSXz" +curl -g --header "PRIVATE-TOKEN: $PUB_DEXED_RLZ" \ + --header 'Content-Type: application/json' \ + --request DELETE "https://gitlab.com/api/v4/projects/15908229/jobs/"$1"/artifacts"