-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: check images for fastlane and docs #488
Conversation
scripts/upload-apk.sh
Outdated
|
||
# Copy Screenshots | ||
mkdir -p "fastlane/metadata/android/en-US/images/phoneScreenshots" | ||
find docs -type f -name "screen-?.png" -exec cp {} "fastlane/metadata/android/en-US/images/phoneScreenshots/" \; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use cp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah not using regex, glob can work even in cp. Updated
Need to find a solution to have F-Droid work as well with this. It won't find the images in this case |
fd8ed9a
to
5d744b9
Compare
Yes true, let me look what else can I do |
@iamareebjamal we should not have problem duplicating content |
Not the case with binaries. But let me check, maybe I am wrong |
Yeah, it'll work. Please go ahead. However, please fail the build if there are different count of images in fastlane and docs folder so that when an image is added in one of them, it reminds the developer to add image in the other folder as well |
@iamareebjamal yeah that sounds right. Will get it done in some time |
9d31d19
to
c8eba92
Compare
c8eba92
to
a242e41
Compare
@iamareebjamal I did not opt to check the count rather I check the md5 which will give us the exact content duplication difference. Failing Build Result: https://travis-ci.com/fossasia/badge-magic-android/builds/126048064 |
a242e41
to
5a7fd6a
Compare
scripts/check-screenshots.sh
Outdated
FILES_DIFF=$(diff <(find docs/images -type f -name "screen-?.png" -exec md5sum {} + | sort -k 2 | sed 's/ .*\// /') <(find fastlane/metadata/android/en-US/images/phoneScreenshots -type f -exec md5sum {} + | sort -k 2 | sed 's/ .*\// /')) | ||
if [[ $FILES_DIFF ]]; then | ||
echo -e "\033[0;31mScreenshots in docs/images and fastlane/metadata/android/en-US/images/phoneScreenshots are not same\033[0m" >&2 | ||
exit 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not exit 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes 1 is for general errors, we can use that as well. I just wanted to make it unique to our application so I chose a random 5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to use standard errors. CI may be hardcoded to understand only 1 exit code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iamareebjamal yes true, updated with exit 1
5a7fd6a
to
8d95fdb
Compare
Fixes #486
Changes: