forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
42 lines (38 loc) · 1.74 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
machine:
services:
- docker
checkout:
post:
# Nasty hack: Because we get a new clone of the repo, timestamps don't
# correspond any more to when the file was last changed.
# To rectify this, first set everything to a timestamp in the past and then
# update the timestamp for all git-tracked files based on their last
# committed change.
- find . -exec touch -t 201401010000 {} \;
- for x in $(git ls-tree --full-tree --name-only -r HEAD); do touch -t $(date -d "$(git log -1 --format=%ci "${x}")" +%y%m%d%H%M.%S) "${x}"; done
dependencies:
cache_directories:
- "~/docker"
override:
# If there's a base image cached, load it. A click on CircleCI's "Clear
# Cache" will make sure we start with a clean slate.
- mkdir -p ~/docker
- if [[ -e ~/docker/base.tar ]]; then docker load -i ~/docker/base.tar; fi
- ./build/build-docker-dev.sh
- docker save "cockroachdb/cockroach-devbase" > ~/docker/base.tar
- if [[ ! -e ~/docker/dnsmasq.tar ]]; then docker pull "cockroachdb/dnsmasq" && docker save "cockroachdb/dnsmasq" > ~/docker/dnsmasq.tar; else docker load -i ~/docker/dnsmasq.tar; fi
# Print the history so that we can investigate potential steps which fatten
# the image needlessly.
- docker history "cockroachdb/cockroach-dev"
test:
override:
- docker run "cockroachdb/cockroach-dev" test
- make acceptance
deployment:
docker:
branch: master
commands:
# Build static binary container only on master.
- sed "s/<EMAIL>/$DOCKER_EMAIL/;s/<AUTH>/$DOCKER_AUTH/" < "resources/deploy_templates/.dockercfg.template" > ~/.dockercfg
- if [ -n "$DOCKER_EMAIL" ]; then ./build/build-docker-deploy.sh && docker push cockroachdb/cockroach; fi:
timeout: 600