This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 673
Convert CI build to CircleCI 2.0 #3270
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
911751d
Remove docs-only support in CI - docs moved to Netlify
bboreham 3699f89
Add docker command to build container
bboreham 76ee987
Add coverage commands to build image
bboreham 0164d24
Tag build image with current git commit
bboreham fc77e33
Move circleci config to 2.0 location
bboreham 8620d0a
Change CircleCI config to 2.0 version
bboreham 6337972
Don't need to pipe background commands to file in Circle 2.0
bboreham b13eb5a
Run gen_coverage as a 'deploy'
bboreham b3e77e8
Split into several jobs
bboreham e3576e1
Don't copy the source directory somewhere else
bboreham 1a8794e
Run coverage analysis in separate step, and save results
bboreham 44e0c6a
Try to fix failing test 840
bboreham e3231bb
Stop running VM creation in the background
bboreham e64656d
Specify https for security
bboreham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
version: 2 | ||
defaults: &defaults | ||
docker: | ||
- image: weaveworks/weavebuild:circle20-2e6504d3 | ||
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 | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- test/coverage | ||
|
||
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 | ||
working_directory: /home/circleci/src/github.com/weaveworks/weave | ||
environment: | ||
SRCDIR: /home/circleci/src/github.com/weaveworks/weave | ||
CIRCLE_ARTIFACTS: /tmp/artifacts | ||
parallelism: 2 | ||
steps: | ||
- checkout | ||
- run: mkdir $CIRCLE_ARTIFACTS | ||
- run: git submodule update --init | ||
- attach_workspace: | ||
at: . | ||
# kick off creation of test VMs | ||
- run: bin/provision_test_vms.sh | ||
# when VMs are ready, copy built software to them | ||
- run: bin/circle-test-pre | ||
- run: | ||
command: bin/circle-test-smoke | ||
no_output_timeout: 360s | ||
# Destroy testing VMs: | ||
- run: | ||
command: bin/circle-destroy-vms | ||
background: true | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- test/coverage | ||
- store_artifacts: | ||
path: /tmp/artifacts | ||
|
||
gen-coverage: | ||
<<: *defaults | ||
environment: | ||
CIRCLE_ARTIFACTS: /tmp/artifacts | ||
steps: | ||
- checkout | ||
- run: mkdir $CIRCLE_ARTIFACTS | ||
- attach_workspace: | ||
at: . | ||
- run: cd test; ./gen_coverage_reports.sh | ||
- run: goveralls -repotoken $COVERALLS_REPO_TOKEN -coverprofile=test/profile.cov -service=circleci | ||
- run: cp test/coverage.* $CIRCLE_ARTIFACTS | ||
- 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 | ||
- gen-coverage: | ||
requires: | ||
- unit-test | ||
- smoke-tests | ||
- deploy: | ||
requires: | ||
- smoke-tests | ||
filters: | ||
branches: | ||
only: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
source "$SRCDIR/bin/circle-env" | ||
cd "$SRCDIR/test" | ||
./run-integration-tests.sh destroy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Set environment variables here because CircleCI can't expand $FOO in 'env' section | ||
|
||
export PATH="$PATH:$HOME/.local/bin:/opt/google-cloud-sdk/bin" | ||
export CLOUDSDK_CORE_DISABLE_PROMPTS=1 | ||
# Base name of VMs for integration tests: | ||
export NAME=test-$CIRCLE_BUILD_NUM-$CIRCLE_NODE_INDEX | ||
export TEST_VMS_PROV_AND_CONF_LOCK_FILE=$CIRCLE_ARTIFACTS/test_vms_provisioned_and_configured.txt | ||
export TEST_VMS_READY_LOCK_FILE=$CIRCLE_ARTIFACTS/test_vms_ready.txt | ||
# Google Cloud Platorm images for integration tests: | ||
export USE_IMAGE=1 | ||
export DISK_NAME_PREFIX=test-$CIRCLE_BUILD_NUM-0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
Sorry, something went wrong.