-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support cache for browser installation (#119)
* Trying to implement caching: chrome test 1 * Add fixes for test 1 * fix lint * add test with cache * Fix * Validate file existenceW * Cleanup cache after process * Fix typo * Add debu * Verify cache is breaking checkout * Adding log * Add more debug * Add more debug * Add more debug * update cache management * Update sudo * Updat test * Add link * Add debug * Add extra links * Update tests to have checkout * Rever jq orb update * Use another jq orb version * Add cache from macos * Update save_cache step * Save cache before delete * Update process-cache * fix * Add cache for firefox * Fix linting * fix cache usage * Update cache key for firefox test * update cache key construction * Update use_cache parameter description
- Loading branch information
1 parent
22701d0
commit abf377b
Showing
6 changed files
with
160 additions
and
10 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,19 @@ | ||
#!/bin/bash | ||
set -x | ||
if [[ $EUID == 0 ]]; then export SUDO=""; else export SUDO="sudo"; fi | ||
if [ -f "/tmp/chrome.tar.gz" ]; then | ||
if uname -a | grep Darwin >/dev/null 2>&1; then | ||
$SUDO tar -xzf /tmp/chrome.tar.gz -C /tmp | ||
elif command -v apt-get >/dev/null 2>&1; then | ||
$SUDO mkdir -p /opt/google/chrome | ||
$SUDO tar -xzf /tmp/chrome.tar.gz -C /opt/google/chrome | ||
$SUDO rm -rf /tmp/chrome.tar.gz | ||
$SUDO ln -s /opt/google/chrome/google-chrome "/usr/bin/google-chrome-$ORB_PARAM_CHANNEL" | ||
$SUDO ln -s "/usr/bin/google-chrome-$ORB_PARAM_CHANNEL" "/etc/alternatives/google-chrome" | ||
$SUDO ln -s "/etc/alternatives/google-chrome" "/usr/bin/google-chrome" | ||
else | ||
echo "This system doesn't support cache for chrome" | ||
$SUDO rm -rf /tmp/chrome.tar.gz | ||
fi | ||
fi | ||
set +x |