From f4371f2635ed90ec406c692a38915b96c1cb3729 Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Thu, 9 Aug 2018 10:28:06 +0200 Subject: [PATCH 01/11] Machine translated --- circle.yml | 125 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 103 insertions(+), 22 deletions(-) diff --git a/circle.yml b/circle.yml index 35ace2ce8..2d8a71195 100644 --- a/circle.yml +++ b/circle.yml @@ -1,27 +1,108 @@ -machine: - pre: - - curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0 - - sudo rm -rf /usr/local/go - - curl -sSL https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz | sudo tar xz -C /usr/local - services: - - docker - -dependencies: - pre: - - sudo curl -L "https://github.com/docker/compose/releases/download/1.10.0/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose - - sudo chmod +x /usr/local/bin/docker-compose - - docker-compose -f docker-compose-integration.yml up -d --force-recreate - -test: - pre: - - mkdir -p /home/ubuntu/.go_workspace/src/github.com/go-kit - - mv /home/ubuntu/kit /home/ubuntu/.go_workspace/src/github.com/go-kit - - ln -s /home/ubuntu/.go_workspace/src/github.com/go-kit/kit /home/ubuntu/kit - - go get -t github.com/go-kit/kit/... - override: - - go test -v -race -tags integration github.com/go-kit/kit/...: +# This configuration was automatically generated from a CircleCI 1.0 config. +# It should include any build commands you had along with commands that CircleCI +# inferred from your project structure. We strongly recommend you read all the +# comments in this file to understand the structure of CircleCI 2.0, as the idiom +# for configuration has changed substantially in 2.0 to allow arbitrary jobs rather +# than the prescribed lifecycle of 1.0. In general, we recommend using this generated +# configuration as a reference rather than using it in production, though in most +# cases it should duplicate the execution of your original 1.0 config. +version: 2 +jobs: + build: + working_directory: ~/go-kit/kit + parallelism: 1 + shell: /bin/bash --login + # CircleCI 2.0 does not support environment variables that refer to each other the same way as 1.0 did. + # If any of these refer to each other, rewrite them so that they don't or see https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables . + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + # In CircleCI 1.0 we used a pre-configured image with a large number of languages and other packages. + # In CircleCI 2.0 you can now specify your own image, or use one of our pre-configured images. + # The following configuration line tells CircleCI to use the specified docker image as the runtime environment for you job. + # We have selected a pre-built image that mirrors the build environment we use on + # the 1.0 platform, but we recommend you choose an image more tailored to the needs + # of each job. For more information on choosing an image (or alternatively using a + # VM instead of a container) see https://circleci.com/docs/2.0/executor-types/ + # To see the list of pre-built images that CircleCI provides for most common languages see + # https://circleci.com/docs/2.0/circleci-images/ + docker: + - image: circleci/build-image:ubuntu-14.04-XXL-upstart-1189-5614f37 + command: /sbin/init + steps: + # Machine Setup + # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each + # The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out. + - checkout + # Prepare for artifact and test results collection equivalent to how it was done on 1.0. + # In many cases you can simplify this from what is generated here. + # 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/' + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS + # This is based on your 1.0 configuration file or project settings + - run: + working_directory: ~/go-kit/kit + command: curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0 + - run: + working_directory: ~/go-kit/kit + command: sudo rm -rf /usr/local/go + - run: + working_directory: ~/go-kit/kit + command: curl -sSL https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz | sudo tar xz -C /usr/local + # This is based on your 1.0 configuration file or project settings + - run: + working_directory: ~/go-kit/kit + command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; ' + # Dependencies + # This would typically go in either a build or a build-and-test job when using workflows + # Restore the dependency cache + - restore_cache: + keys: + # This branch if available + - v1-dep-{{ .Branch }}- + # Default branch if not + - v1-dep-master- + # Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly + - v1-dep- + # This is based on your 1.0 configuration file or project settings + - run: sudo curl -L "https://github.com/docker/compose/releases/download/1.10.0/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose + - run: sudo chmod +x /usr/local/bin/docker-compose + - run: docker-compose -f docker-compose-integration.yml up -d --force-recreate + # Save dependency cache + - save_cache: + key: v1-dep-{{ .Branch }}-{{ epoch }} + paths: + # This is a broad list of cache paths to include many possible development environments + # You can probably delete some of these entries + - vendor/bundle + - ~/virtualenvs + - ~/.m2 + - ~/.ivy2 + - ~/.bundle + - ~/.go_workspace + - ~/.gradle + - ~/.cache/bower + # Test + # This would typically be a build job when using workflows, possibly combined with build + # This is based on your 1.0 configuration file or project settings + - run: mkdir -p /home/ubuntu/.go_workspace/src/github.com/go-kit + - run: mv /home/ubuntu/kit /home/ubuntu/.go_workspace/src/github.com/go-kit + - run: ln -s /home/ubuntu/.go_workspace/src/github.com/go-kit/kit /home/ubuntu/kit + - run: go get -t github.com/go-kit/kit/... + # This is based on your 1.0 configuration file or project settings + - run: + command: go test -v -race -tags integration github.com/go-kit/kit/... environment: ETCD_ADDR: http://localhost:2379 CONSUL_ADDR: localhost:8500 ZK_ADDR: localhost:2181 EUREKA_ADDR: http://localhost:8761/eureka + # Teardown + # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each + # Save test results + - store_test_results: + path: /tmp/circleci-test-results + # Save artifacts + - store_artifacts: + path: /tmp/circleci-artifacts + - store_artifacts: + path: /tmp/circleci-test-results From a082c4bfd3902f046f3487de7bac79905e105b53 Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Thu, 9 Aug 2018 10:49:04 +0200 Subject: [PATCH 02/11] Reset to zero --- circle.yml | 108 +++-------------------------------------------------- 1 file changed, 5 insertions(+), 103 deletions(-) diff --git a/circle.yml b/circle.yml index 2d8a71195..f43b9ace4 100644 --- a/circle.yml +++ b/circle.yml @@ -1,108 +1,10 @@ -# This configuration was automatically generated from a CircleCI 1.0 config. -# It should include any build commands you had along with commands that CircleCI -# inferred from your project structure. We strongly recommend you read all the -# comments in this file to understand the structure of CircleCI 2.0, as the idiom -# for configuration has changed substantially in 2.0 to allow arbitrary jobs rather -# than the prescribed lifecycle of 1.0. In general, we recommend using this generated -# configuration as a reference rather than using it in production, though in most -# cases it should duplicate the execution of your original 1.0 config. version: 2 + jobs: build: - working_directory: ~/go-kit/kit - parallelism: 1 - shell: /bin/bash --login - # CircleCI 2.0 does not support environment variables that refer to each other the same way as 1.0 did. - # If any of these refer to each other, rewrite them so that they don't or see https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables . - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - # In CircleCI 1.0 we used a pre-configured image with a large number of languages and other packages. - # In CircleCI 2.0 you can now specify your own image, or use one of our pre-configured images. - # The following configuration line tells CircleCI to use the specified docker image as the runtime environment for you job. - # We have selected a pre-built image that mirrors the build environment we use on - # the 1.0 platform, but we recommend you choose an image more tailored to the needs - # of each job. For more information on choosing an image (or alternatively using a - # VM instead of a container) see https://circleci.com/docs/2.0/executor-types/ - # To see the list of pre-built images that CircleCI provides for most common languages see - # https://circleci.com/docs/2.0/circleci-images/ docker: - - image: circleci/build-image:ubuntu-14.04-XXL-upstart-1189-5614f37 - command: /sbin/init + - image: circleci/golang-1.11beta3-browsers steps: - # Machine Setup - # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each - # The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out. - - checkout - # Prepare for artifact and test results collection equivalent to how it was done on 1.0. - # In many cases you can simplify this from what is generated here. - # 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/' - - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # This is based on your 1.0 configuration file or project settings - - run: - working_directory: ~/go-kit/kit - command: curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0 - - run: - working_directory: ~/go-kit/kit - command: sudo rm -rf /usr/local/go - - run: - working_directory: ~/go-kit/kit - command: curl -sSL https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz | sudo tar xz -C /usr/local - # This is based on your 1.0 configuration file or project settings - - run: - working_directory: ~/go-kit/kit - command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; ' - # Dependencies - # This would typically go in either a build or a build-and-test job when using workflows - # Restore the dependency cache - - restore_cache: - keys: - # This branch if available - - v1-dep-{{ .Branch }}- - # Default branch if not - - v1-dep-master- - # Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly - - v1-dep- - # This is based on your 1.0 configuration file or project settings - - run: sudo curl -L "https://github.com/docker/compose/releases/download/1.10.0/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose - - run: sudo chmod +x /usr/local/bin/docker-compose - - run: docker-compose -f docker-compose-integration.yml up -d --force-recreate - # Save dependency cache - - save_cache: - key: v1-dep-{{ .Branch }}-{{ epoch }} - paths: - # This is a broad list of cache paths to include many possible development environments - # You can probably delete some of these entries - - vendor/bundle - - ~/virtualenvs - - ~/.m2 - - ~/.ivy2 - - ~/.bundle - - ~/.go_workspace - - ~/.gradle - - ~/.cache/bower - # Test - # This would typically be a build job when using workflows, possibly combined with build - # This is based on your 1.0 configuration file or project settings - - run: mkdir -p /home/ubuntu/.go_workspace/src/github.com/go-kit - - run: mv /home/ubuntu/kit /home/ubuntu/.go_workspace/src/github.com/go-kit - - run: ln -s /home/ubuntu/.go_workspace/src/github.com/go-kit/kit /home/ubuntu/kit - - run: go get -t github.com/go-kit/kit/... - # This is based on your 1.0 configuration file or project settings - - run: - command: go test -v -race -tags integration github.com/go-kit/kit/... - environment: - ETCD_ADDR: http://localhost:2379 - CONSUL_ADDR: localhost:8500 - ZK_ADDR: localhost:2181 - EUREKA_ADDR: http://localhost:8761/eureka - # Teardown - # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each - # Save test results - - store_test_results: - path: /tmp/circleci-test-results - # Save artifacts - - store_artifacts: - path: /tmp/circleci-artifacts - - store_artifacts: - path: /tmp/circleci-test-results + - checkout + - run: go version + - run: go env From 0884d6b3ecb2d1b8fd8e5ecda0cf0f310a231b09 Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Thu, 9 Aug 2018 10:50:01 +0200 Subject: [PATCH 03/11] Fix typo in image name --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index f43b9ace4..101a71ec3 100644 --- a/circle.yml +++ b/circle.yml @@ -3,7 +3,7 @@ version: 2 jobs: build: docker: - - image: circleci/golang-1.11beta3-browsers + - image: circleci/golang:1.11beta3-browsers steps: - checkout - run: go version From e58e4a2279c882606ab83bbf23fe008a96e032d5 Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Thu, 9 Aug 2018 10:59:53 +0200 Subject: [PATCH 04/11] Try to get Docker working in the environment --- circle.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 101a71ec3..a8f5b3d42 100644 --- a/circle.yml +++ b/circle.yml @@ -3,8 +3,11 @@ version: 2 jobs: build: docker: - - image: circleci/golang:1.11beta3-browsers + - image: circleci/golang:1.11beta3 steps: - checkout + - setup_remote_docker - run: go version - run: go env + - run: pwd + - run: docker ps -a From 63daf6d897ab5ca0b26af6b0efd317cc8da429c9 Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Thu, 9 Aug 2018 11:16:31 +0200 Subject: [PATCH 05/11] Incremental progress --- circle.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index a8f5b3d42..2c4644be7 100644 --- a/circle.yml +++ b/circle.yml @@ -4,10 +4,11 @@ jobs: build: docker: - image: circleci/golang:1.11beta3 + working_directory: $GOPATH/src/github.com/go-kit/kit steps: - checkout - setup_remote_docker - - run: go version + - run: docker-compose -f docker-compose-integration.yml up -d --force-recreate - run: go env - run: pwd - - run: docker ps -a + - run: ls -ltar \ No newline at end of file From 41a5ba4448476c78d251cdbdff35de23ee3489ac Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Thu, 9 Aug 2018 11:18:56 +0200 Subject: [PATCH 06/11] Debug incremental progress --- circle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index 2c4644be7..cef865d0f 100644 --- a/circle.yml +++ b/circle.yml @@ -8,7 +8,7 @@ jobs: steps: - checkout - setup_remote_docker - - run: docker-compose -f docker-compose-integration.yml up -d --force-recreate - run: go env - run: pwd - - run: ls -ltar \ No newline at end of file + - run: ls -ltar + - run: docker-compose -f docker-compose-integration.yml up -d --force-recreate From d895758c8115aa8e0ed2aed93b148476da8221db Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Thu, 9 Aug 2018 11:21:15 +0200 Subject: [PATCH 07/11] Debug incremental progress --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index cef865d0f..9417c085a 100644 --- a/circle.yml +++ b/circle.yml @@ -4,7 +4,7 @@ jobs: build: docker: - image: circleci/golang:1.11beta3 - working_directory: $GOPATH/src/github.com/go-kit/kit + working_directory: /go/src/github.com/go-kit/kit steps: - checkout - setup_remote_docker From 360e8d48d0269a14b3e744b3f1b1239dd1c884b8 Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Thu, 9 Aug 2018 11:29:55 +0200 Subject: [PATCH 08/11] Final bits, first attempt --- circle.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/circle.yml b/circle.yml index 9417c085a..c820bc81f 100644 --- a/circle.yml +++ b/circle.yml @@ -1,14 +1,18 @@ version: 2 jobs: - build: + test: docker: - image: circleci/golang:1.11beta3 working_directory: /go/src/github.com/go-kit/kit + environment: + ETCD_ADDR: http://localhost:2379 + CONSUL_ADDR: localhost:8500 + ZK_ADDR: localhost:2181 + EUREKA_ADDR: http://localhost:8761/eureka steps: - checkout - setup_remote_docker - - run: go env - - run: pwd - - run: ls -ltar - run: docker-compose -f docker-compose-integration.yml up -d --force-recreate + - run: go get -t github.com/go-kit/kit/... + - run: go test -v -race -tags integration github.com/go-kit/kit/... From c0f69e899b7ceacc98f02b95842f204e36dc603f Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Thu, 9 Aug 2018 11:32:14 +0200 Subject: [PATCH 09/11] The 'build' name is important --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index c820bc81f..297b080bd 100644 --- a/circle.yml +++ b/circle.yml @@ -1,7 +1,7 @@ version: 2 jobs: - test: + build: docker: - image: circleci/golang:1.11beta3 working_directory: /go/src/github.com/go-kit/kit From 8663d7eb32240776b390fe00a302b95227c94d34 Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Thu, 9 Aug 2018 12:38:40 +0200 Subject: [PATCH 10/11] The docker executor can't run docker services --- circle.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/circle.yml b/circle.yml index 297b080bd..d7d2f4166 100644 --- a/circle.yml +++ b/circle.yml @@ -2,8 +2,7 @@ version: 2 jobs: build: - docker: - - image: circleci/golang:1.11beta3 + machine: true working_directory: /go/src/github.com/go-kit/kit environment: ETCD_ADDR: http://localhost:2379 @@ -12,7 +11,6 @@ jobs: EUREKA_ADDR: http://localhost:8761/eureka steps: - checkout - - setup_remote_docker - run: docker-compose -f docker-compose-integration.yml up -d --force-recreate - run: go get -t github.com/go-kit/kit/... - run: go test -v -race -tags integration github.com/go-kit/kit/... From cbd946ad71aa16459973761ff6976912ce056e2a Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Thu, 9 Aug 2018 12:44:18 +0200 Subject: [PATCH 11/11] Machine uses a different GOPATH --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index d7d2f4166..453528c46 100644 --- a/circle.yml +++ b/circle.yml @@ -3,7 +3,7 @@ version: 2 jobs: build: machine: true - working_directory: /go/src/github.com/go-kit/kit + working_directory: /home/circleci/.go_workspace/src/github.com/go-kit/kit environment: ETCD_ADDR: http://localhost:2379 CONSUL_ADDR: localhost:8500