Change CircleCI config to 2.0 version

Environment variables are moved out to a script, because CircleCI 2.0
does not support expansion of '$foo' in 'env' section.
This commit is contained in:
Bryan Boreham committed 2018-07-30 10:16:18 +00:00
1 parent fc77e33d1d
commit 8620d0ae4f
6 files changed
+76 -67

No files matched your search

+51 -66
View File
@@ -1,66 +1,51 @@
general:
branches:
ignore:
- gh\-pages
machine:
pre:
- curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0
services:
- docker
environment:
GOPATH: /home/ubuntu:$GOPATH
SRCDIR: /home/ubuntu/src/github.com/weaveworks/weave
PATH: $PATH:$HOME/.local/bin:/opt/google-cloud-sdk/bin
CLOUDSDK_CORE_DISABLE_PROMPTS: 1
STATE: /home/ubuntu/state.env
# Base name of VMs for integration tests:
NAME: test-$CIRCLE_BUILD_NUM-$CIRCLE_NODE_INDEX
TEST_VMS_SETUP_OUTPUT_FILE: $CIRCLE_ARTIFACTS/test_vms_setup_output.txt
TEST_VMS_PROV_AND_CONF_LOCK_FILE: $CIRCLE_ARTIFACTS/test_vms_provisioned_and_configured.txt
TEST_VMS_READY_LOCK_FILE: $CIRCLE_ARTIFACTS/test_vms_ready.txt
# Google Cloud Platorm images for integration tests:
USE_IMAGE: 1
DISK_NAME_PREFIX: test-$CIRCLE_BUILD_NUM-0
dependencies:
cache_directories:
- "~/docker"
post:
- bin/circle-dependencies-post-sources
# Provision & configure testing VMs:
- "while [ ! -d $SRCDIR ]; do sleep 1; done; $SRCDIR/bin/provision_test_vms.sh":
parallel: true
background: true
- bin/circle-dependencies-post
test:
pre:
- "$SRCDIR/bin/circle-test-pre":
parallel: true
background: true
override:
- "$SRCDIR/bin/circle-test-unit":
parallel: true
- "$SRCDIR/bin/circle-test-smoke":
parallel: true
timeout: 360
post:
- "$SRCDIR/bin/circle-test-teardown":
parallel: true
teardown:
pre:
# Destroy testing VMs:
- "cd $SRCDIR/test && ./run-integration-tests.sh destroy":
parallel: true
background: true
- "$SRCDIR/bin/circle-teardown-pre":
parallel: true
deployment:
master:
branch: master
owner: weaveworks
commands:
- "$SRCDIR/bin/circle-deploy-master"
version: 2
jobs:
build:
machine:
image: circleci/classic:201709-01
environment:
GOPATH: /home/circleci
SRCDIR: /home/circleci/src/github.com/weaveworks/weave
CIRCLE_ARTIFACTS: /tmp/artifacts
parallelism: 2
steps:
- checkout
- run: mkdir $CIRCLE_ARTIFACTS
# copy source dir and submodule update --init
- run: bin/circle-dependencies-post-sources
- restore_cache:
key: v1-cache-{{ checksum "build/Dockerfile" }}-{{ checksum "build/build.sh" }}
# kick off creation of test VMs
- run:
command: bin/provision_test_vms.sh
background: true
# create build image and make all
- run: bin/circle-dependencies-post
- save_cache:
key: v1-cache-{{ checksum "build/Dockerfile" }}-{{ checksum "build/build.sh" }}
paths:
- "~/docker"
# when VMs are ready, copy built software to them
- run:
command: bin/circle-test-pre
background: true
- run: bin/circle-test-unit
- run:
command: bin/circle-test-smoke
no_output_timeout: 360s
# Generate code coverage reports
- run: bin/circle-test-teardown
# Destroy testing VMs:
- run:
command: bin/circle-destroy-vms
background: true
# run goveralls; copy coverage reports to artifacts dir
- deploy:
command: $SRCDIR/bin/circle-teardown-pre
- store_artifacts:
path: /tmp/artifacts
- deploy:
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
bin/circle-deploy-master
fi