-
Notifications
You must be signed in to change notification settings - Fork 14
/
asset_checksum
executable file
·28 lines (25 loc) · 1.34 KB
/
asset_checksum
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Theme files to reset -- see .gitignore
# Remove anything on these paths to ensure lingering theme files from other clients do not interfere.
find app/assets -type f -name '.DS_Store' -delete
rm -rf app/assets/stylesheets/theme/styles
rm -rf app/assets/images/theme/logo
rm -rf app/assets/images/theme/icons
rm -rf app/assets/images/icons
if [ "$ASSETS_PREFIX" = "" ]; then
export ASSETS_PREFIX=qa-warehouse-staging-ecs
fi
# Pull down our client theme files.
ASSETS_BUCKET_NAME=openpath-ecs-assets UPDATE_ONLY=false ./bin/sync_app_assets.rb > /dev/null 2>&1
# Use tar to create a content hash of the assets folder and the client secrets.
# The below flags are intended to strip or normalize all metadata so that we're only hashing on contents.
# This has been adapted from several different StackOverflow suggestions for no-metadata tarring.
tar -cf - --sort=name `# Force sorting` \
--mtime='UTC 2019-01-01' `# Normalize modified time.` \
--group=0 `# Normalize group owner.` \
--owner=0 `# Normalize user owner.` \
--numeric-owner `# Use numeric values for owner so our normalized values always match.` \
--absolute-names `# Force absolute paths` \
--no-acls `# No ACLs` \
--mode="go-rwx,u-rw" `# Normalize permissions` \
--exclude=.keep,*.rbc,**.orig,*.swp `# Exclude a few files we know we don't care about` \
app/assets | md5sum | cut -d ' ' -f 1