Simplify Travis config and fix release process

This commit is contained in:
Mislav Marohnić 2016-08-21 15:57:31 +02:00
Родитель 4151f88470
Коммит d1cb6d7d12
4 изменённых файлов: 13 добавлений и 13 удалений

Просмотреть файл

@ -1,20 +1,14 @@
os:
- linux
- osx
sudo: false sudo: false
before_install: before_install:
- export BUNDLE_GEMFILE=$PWD/Gemfile - export BUNDLE_GEMFILE=$PWD/Gemfile
- export TRAVIS_RUBY_VERSION="$(ruby -e 'puts RUBY_VERSION')-travis" - export TRAVIS_RUBY_VERSION="$(ruby -e 'puts RUBY_VERSION')-travis"
- script/bootstrap
- export PATH=~/bin:"$PATH" - export PATH=~/bin:"$PATH"
language: go language: go
go: go:
- 1.6.3 - 1.6.3
script: make test-all script: make test-all
install: script/cached-bundle install --without development --deployment --jobs=3 --retry=3 install: script/bootstrap
after_success: script/publish-release after_success: script/publish-release
notifications:
email: false
env: env:
global: global:
- AMAZON_S3_BUCKET=ci-cache - AMAZON_S3_BUCKET=ci-cache

Просмотреть файл

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
if [ -n "$TRAVIS" ]; then if [ -n "$TRAVIS" ] && [ ! -x ~/bin/tmux ]; then
case "$TRAVIS_OS_NAME" in case "$TRAVIS_OS_NAME" in
linux ) cache_name="tmux-zsh.ubuntu" ;; linux ) cache_name="tmux-zsh.ubuntu" ;;
osx ) cache_name="tmux.osx" ;; osx ) cache_name="tmux.osx" ;;
@ -12,7 +12,6 @@ if [ -n "$TRAVIS" ]; then
esac esac
curl -fsSL "https://${AMAZON_S3_BUCKET}.s3.amazonaws.com/${cache_name}.tgz" | tar -xz -C ~ curl -fsSL "https://${AMAZON_S3_BUCKET}.s3.amazonaws.com/${cache_name}.tgz" | tar -xz -C ~
exit 0
fi fi
STATUS=0 STATUS=0
@ -23,7 +22,11 @@ if ! go version; then
fi fi
{ ruby --version { ruby --version
bundle install --path vendor/bundle if [ -n "$TRAVIS" ]; then
script/cached-bundle install --deployment --jobs=3 --retry=3
else
bundle install --path vendor/bundle
fi
bundle binstub cucumber ronn --path bin bundle binstub cucumber ronn --path bin
} || { } || {
echo "You need Ruby 1.9 or higher and Bundler to run hub tests" >&2 echo "You need Ruby 1.9 or higher and Bundler to run hub tests" >&2

Просмотреть файл

@ -31,15 +31,17 @@ bundle_path="vendor/bundle"
gemfile_hash="$(compute_md5 <"${BUNDLE_GEMFILE:-Gemfile}.lock")" gemfile_hash="$(compute_md5 <"${BUNDLE_GEMFILE:-Gemfile}.lock")"
cache_name="${TRAVIS_RUBY_VERSION}-${gemfile_hash}.${TRAVIS_OS_NAME}.tgz" cache_name="${TRAVIS_RUBY_VERSION}-${gemfile_hash}.${TRAVIS_OS_NAME}.tgz"
fetch_url="http://${AMAZON_S3_BUCKET}.s3.amazonaws.com/${TRAVIS_REPO_SLUG}/${cache_name}" fetch_url="http://${AMAZON_S3_BUCKET}.s3.amazonaws.com/${TRAVIS_REPO_SLUG}/${cache_name}"
bundle_log="$(mktemp /tmp/bundle.XXXX)"
if download "$fetch_url" "$cache_name"; then if download "$fetch_url" "$cache_name"; then
echo "Reusing cached bundle ${cache_name}" echo "Reusing cached bundle ${cache_name}"
tar xzf "$cache_name" tar xzf "$cache_name"
fi fi
bundle "$@" set -o pipefail
bundle "$@" | tee "$bundle_log"
if [ ! -f "$cache_name" ] && [ -n "$AMAZON_SECRET_ACCESS_KEY" ]; then if grep -q '^Installing' "$bundle_log" && [ -n "$AMAZON_SECRET_ACCESS_KEY" ]; then
echo "Caching \`${bundle_path}' to S3" echo "Caching \`${bundle_path}' to S3"
tar czf "$cache_name" "$bundle_path" tar czf "$cache_name" "$bundle_path"
script/s3-put "$cache_name" "${AMAZON_S3_BUCKET}:${TRAVIS_REPO_SLUG}/${cache_name}" script/s3-put "$cache_name" "${AMAZON_S3_BUCKET}:${TRAVIS_REPO_SLUG}/${cache_name}"

Просмотреть файл

@ -4,5 +4,6 @@ set -e
if [[ $TRAVIS_TAG == v* ]] && [ "$TRAVIS_OS_NAME" = "linux" ] && [ -n "$GITHUB_OAUTH" ]; then if [[ $TRAVIS_TAG == v* ]] && [ "$TRAVIS_OS_NAME" = "linux" ] && [ -n "$GITHUB_OAUTH" ]; then
version="${TRAVIS_TAG#v}" version="${TRAVIS_TAG#v}"
make man-pages make man-pages
script/cross-compile "$version" | script/github-release hub "$version" script/cross-compile "$version" | \
PATH="bin:$PATH" script/github-release hub "$version"
fi fi