Skip to content

Commit 0cc3fc2

Browse files
committed
Add script to push assets
1 parent 2ec9b76 commit 0cc3fc2

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"data:generate": "node ./scripts/data/generate.js",
2626
"data:update-popularity": "node ./scripts/data/update-popularity.js",
2727
"data:push-algolia": "node ./scripts/data/push-algolia.js",
28+
"data:push-images": "./scripts/data/push-images",
2829
"ci": "./scripts/ci",
2930
"lint": "./scripts/lint",
3031
"lint:fix": "./scripts/lint-fix",

scripts/data/push-algolia.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@ await pMap(generatedSources, async (filepath) => {
1212
const data = await readJson(filepath);
1313
const { episode, subtitles } = data;
1414
const episodeRecords = _.map(subtitles, (subtitle) => {
15+
// Move .media key to the root
16+
const media = subtitle.media;
17+
delete subtitle.media;
18+
1519
return {
1620
episode,
1721
subtitle,
22+
media,
1823
};
1924
});
2025
records.push(...episodeRecords);

scripts/data/push-images

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
rsync \
5+
--chmod=Du=rwx,Dg=rwx,Do=rx,Fu=rw,Fg=rw,Fo=r \
6+
--verbose \
7+
--archive \
8+
--update \
9+
--delete \
10+
--prune-empty-dirs \
11+
--copy-links \
12+
--compress \
13+
./data/source/images/thumbnails \
14+
./data/source/images/previews \
15+
pixelastic:/var/www/assets.pixelastic.com/brefsearch

0 commit comments

Comments
 (0)