README.md 935 Bytes
Newer Older
Francesco Gionghi's avatar
Francesco Gionghi committed
1
This script must be run on a Linux computer.
Nicola Lorenzi's avatar
Nicola Lorenzi committed
2
3

Software Requirements: `curl`  ,  `jq`
Nicola Lorenzi's avatar
Nicola Lorenzi committed
4

Francesco Gionghi's avatar
Francesco Gionghi committed
5
6
7
8
9
10
You can check how much space your artifact are using in `settings --> usage quotas`

# What it does
The script will NOT delete the 100 most recent artifacts, but only the older ones. 

To delete ALL artifacts you should edit [line 36](https://gitlab.fbk.eu/fbk-scripts/deleteartifacts/-/blob/main/deleteartifacts.sh#L36) from:
Francesco Gionghi's avatar
Francesco Gionghi committed
11

Francesco Gionghi's avatar
Francesco Gionghi committed
12
`for ((i=2;i<=${total_pages};i++)) #starting with page 2 skipping most recent 100 Jobs`
Francesco Gionghi's avatar
Francesco Gionghi committed
13

Francesco Gionghi's avatar
Francesco Gionghi committed
14
to:
Francesco Gionghi's avatar
Francesco Gionghi committed
15

Francesco Gionghi's avatar
Francesco Gionghi committed
16
17
18
19
`for ((i=1;i<=${total_pages};i++))`



Francesco Gionghi's avatar
Francesco Gionghi committed
20
# Usage
Francesco Gionghi's avatar
Francesco Gionghi committed
21
1. Create a token here: https://gitlab.fbk.eu/-/profile/personal_access_tokens
Francesco Gionghi's avatar
Francesco Gionghi committed
22
2. Find the id of the project: 
Francesco Gionghi's avatar
Francesco Gionghi committed
23

Francesco Gionghi's avatar
Francesco Gionghi committed
24
![projectId](/deleteartifacts.png)
Francesco Gionghi's avatar
Francesco Gionghi committed
25

Francesco Gionghi's avatar
Francesco Gionghi committed
26
27
3. Run `deleteartifact.sh` passing as first argument the `token` and second argument the `projectId`  :
    - curl -L https://gitlab.fbk.eu/fbk-scripts/deleteartifacts/-/raw/main/deleteartifacts.sh | bash -s -- token projectId
Francesco Gionghi's avatar
Francesco Gionghi committed
28
29
30
31




Francesco Gionghi's avatar
Francesco Gionghi committed
32