fescobar / allure-docker-service

This docker container allows you to see up to date reports simply mounting your "allure-results" directory in the container (for a Single Project) or your "projects" directory (for Multiple Projects). Every time appears new results (generated for your tests), Allure Docker Service will detect those changes and it will generate a new report automatically (optional: send results / generate report through API), what you will see refreshing your browser.
Apache License 2.0
636 stars 183 forks source link

If there is a "0" in the project name, the script does not clear old reports. #253

Open serg-kosyak opened 4 months ago

serg-kosyak commented 4 months ago

Hi @fescobar https://github.com/fescobar/allure-docker-service/blob/aeb786e1f856297e9eeebcd93596a4e14335405f/allure-docker-scripts/keepAllureLatestHistory.sh#L11

If there is a "0" in the project name, the script does not clear old reports. Screenshot 2024-05-02 121232

It looks like it's because of this: grep -wv 0 Here is result of command without this grep: Screenshot 2024-05-02 122148

Here is result without flag --invert-match (-v): grep -w 0 image As you can see, it filters all reports because of the Zero in the project name.

serg-kosyak commented 4 months ago

@fescobar It might be better to go into the project folder first and then clean up. (look to my pull request) I mean cd $STATIC_CONTENT_PROJECTS/$PROJECT_ID/ and then CURRENT_SIZE=$(ls -Ad reports/* | grep -wv reports/latest | grep -wv 0 | grep -v $EMAILABLE_REPORT_FILE_NAME | wc -l)