diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..2d4bd426 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,38 @@ +version: 2 + +# https://circleci.com/blog/circleci-hacks-reuse-yaml-in-your-circleci-config-with-yaml/ +defaults: &defaults +# Process to update the build container is: +# Check out desired version of this repo; 'make common-build/.uptodate'; docker push + docker: + - image: weaveworks/common-build:circle20-cfa562b + working_directory: /go/src/github.com/weaveworks/common + +workflows: + version: 2 + test-build-deploy: + jobs: + - lint + - test + +jobs: + lint: + <<: *defaults + steps: + - checkout + - run: + name: Lint + command: | + touch common-build/.uptodate && + make BUILD_IN_CONTAINER=false lint + + test: + <<: *defaults + steps: + - checkout + - run: + name: Test + command: | + dep ensure && + touch common-build/.uptodate && + make BUILD_IN_CONTAINER=false test diff --git a/circle.yml b/circle.yml deleted file mode 100644 index c0ed0092..00000000 --- a/circle.yml +++ /dev/null @@ -1,32 +0,0 @@ -machine: - services: - - docker - environment: - REPO_ROOT: ${HOME}/.go_workspace/src/github.com/weaveworks/common - -dependencies: - cache_directories: - - "~/docker" - post: - # Get the dependencies - - mkdir -p ${HOME}/.go_workspace/src/github.com/weaveworks && cp -r ${HOME}/${CIRCLE_PROJECT_REPONAME}/ ${REPO_ROOT} - - # Don't use master dep until https://github.com/weaveworks/common/pull/36 is fixed - #- go get -u github.com/golang/dep/cmd/dep && cd ${REPO_ROOT}/${CIRCLE_PROJECT_REPONAME} && dep ensure -v - # This version is 54b4235, built by Tom. - - | - curl -fsSLo dep 'https://drive.google.com/uc?export=download&id=0BwqTw528sZRIUzExY29ZMm5LVTQ' && \ - echo "f006f1e41b177e84df36116e08d23f364b7f2d7549c45221c6c7e90b2148cb7f dep" | sha256sum -c && \ - chmod +x dep && mkdir -p ${HOME}/.go_workspace/bin/ && mv dep ${HOME}/.go_workspace/bin/ && \ - cd ${REPO_ROOT}/ && dep ensure -v - - # Cache the build image - - | - cd ${REPO_ROOT}/common-build && \ - ../tools/rebuild-image weaveworks/common-build . build.sh Dockerfile && \ - touch .uptodate - -test: - override: - - cd ${REPO_ROOT}; make RM= lint - - cd ${REPO_ROOT}; make RM= test