Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Convert CI build to CircleCI 2.0 #3270

Merged
merged 14 commits into from
Aug 2, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Split into several jobs
Run build, lint and unit-test steps in a container, using a pre-built
image to save rebuilding at CircleCI

Move a couple of scripts up to config.yml for clarity
  • Loading branch information
bboreham committed Jul 30, 2018
commit b3e77e81ea775c1929fa0287a6a2d1757c6c6e76
73 changes: 60 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
version: 2
defaults: &defaults
docker:
- image: weaveworks/weavebuild:circle20-50a4e941
working_directory: /go/src/github.com/weaveworks/weave

jobs:
lint:
<<: *defaults
steps:
- checkout
- run: git submodule update --init
- run: make DEBUG=1 BUILD_IN_CONTAINER=false lint

unit-test:
<<: *defaults
parallelism: 2
steps:
- checkout
- run: COVERDIR=test/coverage make BUILD_IN_CONTAINER=false tests

build:
<<: *defaults
steps:
- checkout
- setup_remote_docker
- run: git submodule update --init
- run: make COVERAGE=true BUILD_IN_CONTAINER=false SUDO= exes all
- persist_to_workspace:
root: .
paths:
- weave.tar.gz
- tools/runner/runner
- test/tls/tls

smoke-tests:
machine:
image: circleci/classic:201709-01

This comment was marked as abuse.

This comment was marked as abuse.

environment:
Expand All @@ -13,23 +46,16 @@ jobs:
- 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" }}
- attach_workspace:
at: /home/circleci/src/github.com/weaveworks/weave
# 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
Expand All @@ -44,8 +70,29 @@ jobs:
command: $SRCDIR/bin/circle-teardown-pre
- store_artifacts:
path: /tmp/artifacts

deploy:
<<: *defaults
steps:
- setup_remote_docker
# Rebuild without coverage and push to dockerhub
- deploy: bin/circle-deploy-master

workflows:
version: 2
build_test:
jobs:
- lint
- unit-test
- build
- smoke-tests:
requires:
- lint
- unit-test
- build
- deploy:
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
bin/circle-deploy-master
fi
requires:
- smoke-tests
filters:
branches:
only: master
13 changes: 0 additions & 13 deletions bin/circle-dependencies-post

This file was deleted.

2 changes: 1 addition & 1 deletion bin/circle-deploy-master
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
cd $SRCDIR
make clean-bin
# CircleCI doesn't let us install the qemu module to do ARM docker builds
make publish ALL_ARCHITECTURES=amd64 UPDATE_LATEST=latest-only
make publish ALL_ARCHITECTURES=amd64 UPDATE_LATEST=latest-only SUDO= BUILD_IN_CONTAINER=false
7 changes: 0 additions & 7 deletions bin/circle-test-unit

This file was deleted.