2018-11-11 10:58:17 +00:00
|
|
|
#!/bin/bash
|
2018-11-11 05:04:10 +00:00
|
|
|
# Script to setup the assets clone of the repository using GIT_ASSETS_BRANCH and
|
|
|
|
# GIT_API_KEY.
|
|
|
|
|
2018-11-11 05:56:36 +00:00
|
|
|
[ ! -z "$GIT_ASSETS_BRANCH" ] || exit 1
|
|
|
|
[ ! -z "$GIT_API_KEY" ] || exit 1
|
2018-11-11 05:04:10 +00:00
|
|
|
|
|
|
|
setup_git() {
|
|
|
|
git config --global user.email "travis@travis-ci.org" || exit 1
|
|
|
|
git config --global user.name "Travis CI" || exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
# Constants
|
|
|
|
ASSETS_DIR=".assets-branch"
|
|
|
|
|
|
|
|
# Clone the assets branch with the correct credentials
|
|
|
|
git clone --single-branch -b "$GIT_ASSETS_BRANCH" \
|
|
|
|
"https://${GIT_API_KEY}@github.com/${TRAVIS_REPO_SLUG}.git" "$ASSETS_DIR" || exit 1
|
|
|
|
|