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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3270 from weaveworks/circle20
Convert CI build to CircleCI 2.0 Fix #3255
- Loading branch information
Showing
19 changed files
with
195 additions
and
218 deletions.
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.