-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable ccache for Alpine builds on Travis CI
- Loading branch information
1 parent
d4d52ac
commit 97e6127
Showing
9 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -ue | ||
|
||
for dockerfile in **/alpine/Dockerfile; do | ||
# shellcheck disable=SC2016 | ||
sed -Ei -e 's/# Travis CI build deps injection/ ccache netcat-openbsd \\/' \ | ||
-e "s/# Travis CI ccache env setup and cache restore/&\n \&\& nc -v \"\$HOST_IP\" 5678 | tar -xz -C \/ || true \\\/" \ | ||
-e "s/# Travis CI ccache env setup and cache restore/&\n \&\& HOST_IP=\"\$(ip route | awk '\/default\/ { print \$3 \}')\" \\\/" \ | ||
-e 's/# Travis CI ccache env setup and cache restore/&\n \&\& ccache --set-config=max_size=150MB \\/' \ | ||
-e 's/# Travis CI ccache env setup and cache restore/\&\& export PATH="\/usr\/lib\/ccache\/bin\/:$PATH" \\/' \ | ||
-e 's/# Travis CI ccache summary, store and cleanup/&\n \&\& rm -rf \/root\/.ccache\/ \\/' \ | ||
-e 's/# Travis CI ccache summary, store and cleanup/&\n \&\& ccache -s 1>\&2 \\/' \ | ||
-e 's/# Travis CI ccache summary, store and cleanup/\&\& tar -czf - \/root\/.ccache\/ | nc -v -w 3 "$HOST_IP" 1234 || true \\/' "${dockerfile}" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters