-
Notifications
You must be signed in to change notification settings - Fork 712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move to CircleCI 2.0 #3333
Merged
Merged
Move to CircleCI 2.0 #3333
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6b4a515
initial
guyfedwards fc7e5bf
fix env defaults
guyfedwards 9efcea4
add docker build image;
guyfedwards 191b6c8
Don't need a third build image
bboreham 89d7ab1
Remove unnecessary file
bboreham ec49a38
Tag build images with git hash
bboreham c1b93c3
Break into steps, use current build images
bboreham c07b6b5
Sleep to stop TestRegistryDelete() failing
bboreham fd08129
Remove deploy-dev job; it isn't used
bboreham d7b4084
Run arm and darwin builds after main build
bboreham ebfed1b
Don't insist the build container is up-to-date when BUILD_IN_CONTAINE…
bboreham 5d029d7
Install docker client in build container
bboreham 8b9d49d
Run client static build
bboreham 1d2a5c6
Set up dependencies for integration test job
bboreham e1552de
'requests' is installed via pip; we don't need to install via apt-get…
bboreham 29e6409
Move all go installs to same Dockerfile step
bboreham cf0d85b
Run coverage as part of integration test job
bboreham 6a51cd8
Tidy up
bboreham 8a0c422
Use newer build image
bboreham 7b9a15e
Combine arm and darwin build jobs
bboreham 1734def
Get deploy step to work
bboreham d9e88c0
Use newer ui-build image
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,178 @@ | ||
version: 2 | ||
|
||
defaults: &defaults | ||
working_directory: /go/src/github.com/weaveworks/scope | ||
docker: | ||
- image: weaveworks/scope-backend-build:circle-2.0-4ad2f14 | ||
|
||
client-defaults: &client-defaults | ||
working_directory: /home/weave/scope | ||
docker: | ||
- image: weaveworks/scope-ui-build:circle-2.0-1734def7 | ||
|
||
workflows: | ||
version: 2 | ||
test_and_deploy: | ||
jobs: | ||
- lint | ||
- unit-test | ||
- client-build | ||
- client-test: | ||
requires: | ||
- client-build | ||
- xplatform-build: | ||
requires: | ||
- build | ||
- build: | ||
requires: | ||
- client-build | ||
- integration-tests: | ||
requires: | ||
- lint | ||
- unit-test | ||
- build | ||
- deploy: | ||
filters: | ||
branches: | ||
only: master | ||
requires: | ||
- client-test | ||
- integration-tests | ||
|
||
jobs: | ||
lint: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- run: make BUILD_IN_CONTAINER=false lint | ||
|
||
unit-test: | ||
<<: *defaults | ||
parallelism: 1 | ||
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
Sorry, something went wrong. |
||
steps: | ||
- checkout | ||
- run: COVERDIR=./coverage make BUILD_IN_CONTAINER=false CODECGEN_UID=23 tests | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- coverage | ||
|
||
# Create client/build/index.html | ||
client-build: | ||
<<: *client-defaults | ||
steps: | ||
- checkout | ||
# Convoluted set of steps here to mimic Makefile actions of bind-mounting different dirs into container | ||
- run: mv client/app /home/weave/ | ||
- run: cd /home/weave; mkdir build ; yarn run build ; mv build scope/client | ||
- run: cd /home/weave; mkdir build-external; yarn run build-external; mv build-external scope/client | ||
- run: cd /home/weave; mkdir tmp ; yarn run bundle ; mv tmp scope | ||
- persist_to_workspace: | ||
root: /home/weave/scope | ||
paths: | ||
- client/build/ | ||
- client/build-external/ | ||
- tmp/weave-scope.tgz | ||
|
||
client-test: | ||
<<: *client-defaults | ||
steps: | ||
- checkout | ||
- run: | | ||
mv client/app client/test /home/weave/ | ||
cd /home/weave; yarn run lint | ||
cd /home/weave; yarn test | ||
xplatform-build: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- run: GOARCH=arm make BUILD_IN_CONTAINER=false GO_BUILD_INSTALL_DEPS= prog/scope | ||
- run: GOOS=darwin make BUILD_IN_CONTAINER=false GO_BUILD_INSTALL_DEPS= prog/scope | ||
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
Sorry, something went wrong. |
||
|
||
build: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- setup_remote_docker | ||
- attach_workspace: | ||
at: . | ||
- run: make BUILD_IN_CONTAINER=false SUDO= static all | ||
- run: cd extras; make BUILD_IN_CONTAINER=false | ||
- run: make -C tools/runner | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- scope.tar | ||
- cloud-agent.tar | ||
- tools/runner/runner | ||
- prog/externalui/ | ||
- prog/staticui/ | ||
- report/report.codecgen.go | ||
- render/detailed/detailed.codecgen.go | ||
|
||
integration-tests: | ||
machine: | ||
image: circleci/classic:201709-01 | ||
working_directory: /home/circleci/src/github.com/weaveworks/scope | ||
environment: | ||
CIRCLE_ARTIFACTS: /tmp/artifacts | ||
CLOUDSDK_CORE_DISABLE_PROMPTS: 1 | ||
GOPATH: /home/circleci/ | ||
parallelism: 2 | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: . | ||
- run: | | ||
sudo apt-get update | ||
sudo apt-get install python-pip jq pv | ||
- run: mkdir $CIRCLE_ARTIFACTS | ||
# kick off creation of test VMs | ||
- run: test -z "$SECRET_PASSWORD" || bin/setup-circleci-secrets "$SECRET_PASSWORD" | ||
- run: test -z "$SECRET_PASSWORD" || (cd integration; ./gce.sh make_template) | ||
- run: test -z "$SECRET_PASSWORD" || (cd integration; ./gce.sh setup && eval $(./gce.sh hosts); ./setup.sh) | ||
- run: make deps; touch tools/runner/runner | ||
# Run all integration tests | ||
- run: | ||
command: test -z "$SECRET_PASSWORD" || (cd integration; eval $(./gce.sh hosts); ./run_all.sh) | ||
no_output_timeout: 5m | ||
# Destroy testing VMs: | ||
- run: | ||
command: test -z "$SECRET_PASSWORD" || (cd integration; ./gce.sh destroy) | ||
background: true | ||
# Code coverage | ||
- run: ./tools/cover/gather_coverage.sh ./coverage | ||
- run: goveralls -repotoken $COVERALLS_REPO_TOKEN -coverprofile=profile.cov -service=circleci | ||
- run: cp coverage.* */*.codecgen.go $CIRCLE_ARTIFACTS | ||
- store_artifacts: | ||
path: /tmp/artifacts | ||
|
||
deploy: | ||
<<: *defaults | ||
environment: | ||
IMAGES: scope cloud-agent | ||
steps: | ||
- checkout | ||
- setup_remote_docker | ||
- attach_workspace: | ||
at: . | ||
- run: | | ||
pip install awscli | ||
docker load -i scope.tar | ||
docker load -i cloud-agent.tar | ||
- run: | | ||
test -z "${DOCKER_USER}" && exit 0 | ||
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS | ||
for IMAGE in $IMAGES; do | ||
test "${DOCKER_ORGANIZATION:-$DOCKER_USER}" = "weaveworks" || docker tag weaveworks/$IMAGE:latest ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:latest | ||
docker tag weaveworks/$IMAGE:latest ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:$(./tools/image-tag) | ||
docker push ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:latest | ||
docker push ${DOCKER_ORGANIZATION:-$DOCKER_USER}/$IMAGE:$(./tools/image-tag) | ||
done | ||
- run: | | ||
test -z "${QUAY_USER}" && exit 0 | ||
docker login -e '.' -u "$QUAY_USER" -p "$QUAY_PASSWORD" quay.io | ||
docker tag weaveworks/scope:$(./tools/image-tag) "quay.io/${QUAY_ORGANIZATION}/scope:$(./tools/image-tag)" | ||
docker push "quay.io/${QUAY_ORGANIZATION}/scope:$(./tools/image-tag)" | ||
- run: test -z "${UI_BUCKET_KEY_ID}" || (make BUILD_IN_CONTAINER=false ui-upload ui-pkg-upload) |
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.