-
Notifications
You must be signed in to change notification settings - Fork 18
/
circle.yml
66 lines (66 loc) · 2.35 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
version: 2
jobs:
rails-test-suite:
docker:
- image: ruby:2.3.8
environment:
RAILS_ENV: test
DATABASE_URL: postgis://root:for_testing@localhost/transitland_datastore_test
- image: postgis/postgis:12-3.2-alpine
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: for_testing
POSTGRES_DB: transitland_datastore_test
steps:
- checkout
- restore_cache:
keys:
- transitland-datastore-{{ checksum "Gemfile.lock" }}
- transitland-datastore-
- run:
name: Install dependencies
command: apt-get update -qq && apt-get install -y libgeos-dev libproj-dev postgresql-client
- run:
name: Install bundle
command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs 4 --retry 3
- save_cache:
key: transitland-datastore-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run:
name: Database setup
command: bundle exec rake db:drop db:create db:structure:load
- run:
name: Run tests
command: bundle exec rake
# - run:
# name: Run profile
# command: mkdir -p $CIRCLE_ARTIFACTS/profiling && bundle exec rake profile:import:nycdot[$CIRCLE_ARTIFACTS/profiling]
build-container-image:
docker:
- image: circleci/buildpack-deps:16.04-curl
steps:
- checkout
- run: sudo apt-get update -qq && sudo apt-get install python-pip python-dev -y
- run: pip install awscli --upgrade --user
- setup_remote_docker
- run: eval $(~/.local/bin/aws ecr get-login --no-include-email)
- run: docker build -t transitland-datastore:${CIRCLE_TAG:-$CIRCLE_BRANCH} .
# - run: docker tag transitland-datastore:${CIRCLE_TAG:-$CIRCLE_BRANCH} ${TRANSITLAND_AWS_ECR}/transitland-datastore:${CIRCLE_TAG:-$CIRCLE_BRANCH}
# - run: docker push ${TRANSITLAND_AWS_ECR}/transitland-datastore:${CIRCLE_TAG:-$CIRCLE_BRANCH}
workflows:
version: 2
test-and-build-workflow:
jobs:
- rails-test-suite:
filters:
tags:
only: /.*/
- build-container-image:
requires:
- rails-test-suite
filters:
tags:
only: /.*/
# branches:
# ignore: /.*/