Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fc-pregmod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pregmodfan
fc-pregmod
Commits
e3e148dd
Commit
e3e148dd
authored
7 years ago
by
Emuis
Browse files
Options
Downloads
Patches
Plain Diff
add cache warming to BuildAndIPFSify.sh
parent
b4da1913
No related branches found
No related tags found
1 merge request
!1451
Add cachewarming to buildandipfsify.sh
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
devTools/BuildAndIPFSify.sh
+23
-0
23 additions, 0 deletions
devTools/BuildAndIPFSify.sh
with
23 additions
and
0 deletions
devTools/BuildAndIPFSify.sh
+
23
−
0
View file @
e3e148dd
...
...
@@ -4,6 +4,10 @@
# add this to crontab:
# */15 * * * * cd ~/FC/fc-pregmod && git pull --ff-only origin pregmod-master > ~/FC/git_pull.log 2>&1
# and do "ln -s ~/FC/fc-pregmod/devTools/BuildAndIPFSify.sh .git/hooks/post-merge"
# NOTE: you may need to define XDG_RUNTIME_DIR in your crontab
# TODO: add logic to figure out if we should use ipfs-cluster instead of using the local instance directly.
# if we use ipfs-cluster we probably don't need to warm ipfs.io's cache.
rm
bin/
*
.html
...
...
@@ -45,3 +49,22 @@ ipfs name publish "$ipfs_hash"
# when it's done it will print something like "Published to $your_pubkey: /ipfs/$ipfs_hash"
# You can view the folder at http://127.0.0.1:8080/ipns/$your_pubkey
# make ipfs.io cache the files
# $XDG_RUNTIME_DIR SHOULD be defined, but there are cases where it wouldn't be
if
[
-z
"
${
XDG_RUNTIME_DIR
+x
}
"
]
;
then
echo
"
\$
XDG_RUNTIME_DIR is unset, bailing"
exit
2
fi
# throw it into a file so we can loop over lines, not "strings delimited by whitespace"
find ../resources/ bin
-print
|
grep
-ve
'.gitignore'
|
sed
-e
's|\.\./||'
-e
's|bin/||'
-e
'/bin$/d'
|
grep
-Ee
'.+\.svg'
-e
'.html'
>
"
${
XDG_RUNTIME_DIR
}
/files.list"
# ipfs PeerID, it's user specific
PeerID
=
"
$(
ipfs config show |
grep
-e
'PeerID'
|
cut
-d
:
-f
2 |
tr
-d
' "'
)
"
while
IFS
=
read
-r
item
do
echo
"https://ipfs.io/ipns/
${
PeerID
}
/
${
item
}
"
done
<
"
${
XDG_RUNTIME_DIR
}
/files.list"
| xargs
--max-procs
=
10
--max-args
=
1
--replace
curl
--silent
--show-error
--range
0-499
--output
/dev/null
'{}'
rm
"
${
XDG_RUNTIME_DIR
}
/files.list"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment