Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0bb44c
commit ecdfccf
Showing
6 changed files
with
78 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o nounset | ||
set -o errexit | ||
set -o pipefail | ||
|
||
REPOS_LOCATION="$HOME/.cocoapods/repos" | ||
MASTER_REPO_LOCATION="$REPOS_LOCATION/master" | ||
S3_BUCKET="cocoapods-specs" | ||
|
||
tempfile=$(mktemp) | ||
|
||
cleanup() { | ||
echo "Download from S3 failed, cleaning up and falling back to standard checkout..." | ||
rm -rf "$MASTER_REPO_LOCATION" | ||
rm "$tempfile" | ||
} | ||
|
||
trap cleanup ERR | ||
|
||
# Only install awscli if it's not in the image. pip will exit with | ||
# non-zero exit code if the package is not installed. Hiding all output | ||
# from package installation to not to confuse users. | ||
if ! pip show awscli > /dev/null 2>&1 ; then | ||
sudo pip install --ignore-installed awscli > /dev/null 2>&1 | ||
fi | ||
|
||
rm -rf "$MASTER_REPO_LOCATION" | ||
mkdir -p "$REPOS_LOCATION" | ||
|
||
echo "Downloading CocoaPods master repo from $S3_BUCKET S3 bucket..." | ||
# --no-sign-request forces awscli to not to use any credentials. | ||
aws s3 --no-sign-request cp "s3://$S3_BUCKET/latest.tar.gz" "$tempfile" > /dev/null | ||
|
||
echo "Uncompressing CocoaPods master repo..." | ||
# We expect the structure with the "master" as the top dir in the archive. | ||
tar -C "$REPOS_LOCATION" -xzf "$tempfile" | ||
|
||
echo "Successfully downloaded CocoaPods master repo." | ||
COCOAPODS_GIT_REV="$(cd $MASTER_REPO_LOCATION && git rev-parse HEAD)" | ||
echo "Using specs repo revision $COCOAPODS_GIT_REV." | ||
|
||
rm "$tempfile" |
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,23 @@ | ||
machine: | ||
ruby: | ||
version: system | ||
xcode: | ||
version: "8.3.2" | ||
|
||
dependencies: | ||
override: | ||
- sudo gem update --system | ||
- bundle check || bundle install --path .bundle | ||
- .circle-scripts/fetch-cocoapods-repo-from-s3.sh | ||
cache_directories: | ||
- .bundle | ||
|
||
test: | ||
pre: | ||
- git config --global user.email "tests@cocoapods.org" | ||
- git config --global user.name "CocoaPods Tests" | ||
- bundle exec pod env | ||
override: | ||
- bundle exec rake spec:all: | ||
environment: | ||
COCOAPODS_CI_TASKS: EXAMPLES |