Skip to content

Commit

Permalink
Added circle ci configuration
Browse files Browse the repository at this point in the history
Remove old hatchet script

Fix name of travis setup

Added call to env in hatchet tests

fix ci guards for hatchet

Ensuring Hatchet is run in all appropriate envs

Run bundle exec for rspec

Remove secure env var from travis config
  • Loading branch information
jkutner committed Jun 16, 2017
1 parent 7eeb4e9 commit f850422
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 18 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo: true
branches:
only:
- master
before_install: bash etc/travis-setup.sh
before_install: bash etc/ci-setup.sh
install: true
script: eval "$TEST_CMD"
after_script: heroku keys:remove $USER@`hostname`
Expand All @@ -15,7 +15,6 @@ env:
- HATCHET_DEPLOY_STRATEGY=git
- HATCHET_BUILDPACK_BASE="https://github.com/heroku/heroku-buildpack-clojure.git"
- SHUNIT_HOME="/tmp/shunit2-2.1.6"
- secure: rEuSa4bLpl/tt+kCRIwyDNz9V6u0APfr6bBLXehS1Wv699+F9Rw23hD3GEihGtDrCRcg4tiNUQjmuFjd60hQIl9oaH6f4RqLv6AwdAZJgXV+5NnYck8Eu8IQxYNfh0B6T5p2nMywzGHV3t6/QhyBkDc854TIAznhARo+jlekyrw=
matrix:
- TEST_CMD="/tmp/testrunner/bin/run -c ."
- TEST_CMD="sh hatchet.sh"
- TEST_CMD="bash etc/hatchet-test.sh"
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source "https://rubygems.org"

gem 'heroku_hatchet', :git => 'https://github.com/heroku/hatchet.git'
gem 'rspec-retry'
gem 'rspec-expectations'
85 changes: 85 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
GIT
remote: https://github.com/heroku/hatchet.git
revision: 68db517fb3b13c3e98d5abf24447b6b438b40eaa
specs:
heroku_hatchet (2.0.3)
activesupport (~> 4)
anvil-cli (~> 0)
excon (~> 0)
heroku-api (~> 0)
platform-api (~> 2)
repl_runner (~> 0.0.3)
rrrretry (~> 1)
thor (~> 0)
threaded (~> 0)

GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.8)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
anvil-cli (0.16.2)
progress (~> 2.4, >= 2.4.0)
rest-client (~> 1.6, >= 1.6.7)
thor (~> 0.15, >= 0.15.2)
diff-lcs (1.2.5)
domain_name (0.5.20170404)
unf (>= 0.0.5, < 1.0.0)
erubis (2.7.0)
excon (0.57.0)
heroics (0.0.22)
erubis (~> 2.0)
excon
multi_json (>= 1.9.2)
heroku-api (0.4.2)
excon (~> 0.45)
multi_json (~> 1.8)
http-cookie (1.0.3)
domain_name (~> 0.5)
i18n (0.8.4)
mime-types (2.99.3)
minitest (5.10.2)
moneta (0.8.1)
multi_json (1.12.1)
netrc (0.11.0)
platform-api (2.0.0)
heroics (~> 0.0.22)
moneta (~> 0.8.1)
progress (2.4.0)
repl_runner (0.0.3)
activesupport
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
rrrretry (1.0.0)
rspec-core (3.4.1)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-retry (0.4.5)
rspec-core
rspec-support (3.4.1)
thor (0.19.4)
thread_safe (0.3.6)
threaded (0.0.4)
tzinfo (1.2.3)
thread_safe (~> 0.1)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.4)

PLATFORMS
ruby

DEPENDENCIES
heroku_hatchet!
rspec-expectations
rspec-retry

BUNDLED WITH
1.15.1
17 changes: 17 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
machine:
ruby:
version: 2.4.0
environment:
HATCHET_RETRIES: 3
HATCHET_DEPLOY_STRATEGY: git
HATCHET_APP_LIMIT: 10
SHUNIT_HOME: /tmp/shunit2-2.1.6

test:
pre:
- bash etc/ci-setup.sh
override:
- bash etc/hatchet-test.sh
- /tmp/testrunner/bin/run -c .
post:
- heroku keys:remove $USER@`hostname`
File renamed without changes.
19 changes: 16 additions & 3 deletions etc/hatchet-test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
hatchet install &&
if [ -z "$HEROKU_API_KEY" ]; then
echo "Missing \$HEROKU_API_KEY. Skipping."
exit 0
elif [ -n "$CIRCLE_BRANCH" ]; then
export HATCHET_BUILDPACK_BRANCH="$CIRCLE_BRANCH"
elif [ -n "$TRAVIS_PULL_REQUEST_BRANCH" ]; then
export HATCHET_BUILDPACK_BRANCH="$TRAVIS_PULL_REQUEST_BRANCH"
else
export HATCHET_BUILDPACK_BRANCH=$(git name-rev HEAD 2> /dev/null | sed 's#HEAD\ \(.*\)#\1#')
fi

gem install bundler
bundle install

bundle exec hatchet install &&
HATCHET_RETRIES=3 \
HATCHET_DEPLOY_STRATEGY=git \
HATCHET_BUILDPACK_BASE="https://github.com/heroku/heroku-buildpack-clojure.git" \
HATCHET_BUILDPACK_BRANCH=$(git name-rev HEAD 2> /dev/null | sed 's#HEAD\ \(.*\)#\1#') \
rspec $@
bundle exec rspec $@
12 changes: 0 additions & 12 deletions hatchet.sh

This file was deleted.

0 comments on commit f850422

Please sign in to comment.