From fb89eb07bba772c3d79309bdfafb1a0496b85c9c Mon Sep 17 00:00:00 2001 From: Elizabeth Eady Date: Thu, 5 Nov 2020 13:54:04 -0800 Subject: [PATCH] Updating CircleCi config --- .circleci/config.yml | 246 ++++++++++++++++++++++++------------------- 1 file changed, 135 insertions(+), 111 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 84f75622..68d2acc6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,137 +1,161 @@ -version: 2 jobs: - test-install-golang-prev: + dist: docker: - - image: circleci/golang:1.10 - working_directory: /go/src/github.com/segmentio/chamber + - auth: + password: $DOCKER_PASSWORD + username: $DOCKER_USERNAME + image: circleci/golang:1.11 steps: - - checkout - - run: - name: 'Test install golang (previous release)' - command: | - go get -v . && chamber version + - checkout + - run: + command: 'sudo make -f Makefile.tools nfpm-debian rpmbuild-debian - test-install-golang-current: - docker: - - image: circleci/golang:1.11 + ' + name: Install nfpm, rpmbuild + - run: + command: 'make -f Makefile.release dist + + ' + name: Make distributables + - persist_to_workspace: + paths: + - dist/* + root: . working_directory: /go/src/github.com/segmentio/chamber + publish-github: + docker: + - auth: + password: $DOCKER_PASSWORD + username: $DOCKER_USERNAME + image: circleci/golang:1.11 steps: - - checkout - - run: - name: 'Test go get install on current golang release' - command: | - go get -v . && chamber version + - checkout + - attach_workspace: + at: . + - run: + command: 'make -f Makefile.tools github-release - # only need this job until 1.13 is released - test-install-golang-1.11-GOMODULE-on: - docker: - - image: circleci/golang:1.11 + ' + name: Install tools + - run: + command: 'make -f Makefile.release publish-github + + ' + name: Release working_directory: /go/src/github.com/segmentio/chamber + publish-packagecloud: + docker: + - auth: + password: $DOCKER_PASSWORD + username: $DOCKER_USERNAME + image: circleci/golang:1.11 steps: - - checkout - - run: - name: 'Test go get install on golang 1.11 GO111MODULE=on' - command: | - GO111MODULE=on go get -v . && chamber version + - checkout + - attach_workspace: + at: . + - run: + command: "# this is all for package_cloud :/\nsudo apt update -q \nsudo apt\ + \ install -yq ruby ruby-dev build-essential\n# fixes https://askubuntu.com/questions/872399/error-failed-to-build-gem-native-extension-when-trying-to-download-rubocop\n\ + sudo gem install rake\nsudo make -f Makefile.tools package_cloud\n" + name: Install tools + - run: + command: 'make -f Makefile.release publish-packagecloud + ' + name: Release + working_directory: /go/src/github.com/segmentio/chamber test: docker: - - image: circleci/golang:1.11 - working_directory: /go/src/github.com/segmentio/chamber + - auth: + password: $DOCKER_PASSWORD + username: $DOCKER_USERNAME + image: circleci/golang:1.11 steps: - - checkout - - run: - name: Test - command: | - make test + - checkout + - run: + command: 'make test - dist: - docker: - - image: circleci/golang:1.11 + ' + name: Test working_directory: /go/src/github.com/segmentio/chamber + test-install-golang-1.11-GOMODULE-on: + docker: + - auth: + password: $DOCKER_PASSWORD + username: $DOCKER_USERNAME + image: circleci/golang:1.11 steps: - - checkout - - run: - name: Install nfpm, rpmbuild - command: | - sudo make -f Makefile.tools nfpm-debian rpmbuild-debian - - run: - name: Make distributables - command: | - make -f Makefile.release dist - - persist_to_workspace: - root: . - paths: ['dist/*'] + - checkout + - run: + command: 'GO111MODULE=on go get -v . && chamber version - publish-packagecloud: - docker: - - image: circleci/golang:1.11 + ' + name: Test go get install on golang 1.11 GO111MODULE=on working_directory: /go/src/github.com/segmentio/chamber + test-install-golang-current: + docker: + - auth: + password: $DOCKER_PASSWORD + username: $DOCKER_USERNAME + image: circleci/golang:1.11 steps: - - checkout - - attach_workspace: { at: . } - - run: - name: Install tools - command: | - # this is all for package_cloud :/ - sudo apt update -q - sudo apt install -yq ruby ruby-dev build-essential - # fixes https://askubuntu.com/questions/872399/error-failed-to-build-gem-native-extension-when-trying-to-download-rubocop - sudo gem install rake - sudo make -f Makefile.tools package_cloud - - run: - name: Release - command: | - make -f Makefile.release publish-packagecloud + - checkout + - run: + command: 'go get -v . && chamber version - publish-github: - docker: - - image: circleci/golang:1.11 + ' + name: Test go get install on current golang release working_directory: /go/src/github.com/segmentio/chamber + test-install-golang-prev: + docker: + - auth: + password: $DOCKER_PASSWORD + username: $DOCKER_USERNAME + image: circleci/golang:1.10 steps: - - checkout - - attach_workspace: { at: . } - - run: - name: Install tools - command: | - make -f Makefile.tools github-release - - run: - name: Release - command: | - make -f Makefile.release publish-github + - checkout + - run: + command: 'go get -v . && chamber version + ' + name: Test install golang (previous release) + working_directory: /go/src/github.com/segmentio/chamber +version: 2 workflows: - version: 2 test-dist-publish: jobs: - - test - - test-install-golang-prev - - test-install-golang-current - - test-install-golang-1.11-GOMODULE-on - - dist: - # needed to ensure dist happens on tag events - filters: - tags: - only: /.*/ - - publish-packagecloud: - context: packagecloud - requires: - - dist - filters: - # never publish from a branch event - branches: - ignore: /.*/ - # release only on tag push events like vX[.Y.Z...][-whatever] - tags: - only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ - - publish-github: - context: github-segmentcircle-oss-release - requires: - - dist - filters: - # never publish from a branch event - branches: - ignore: /.*/ - # release only on tag push events like vX[.Y.Z...][-whatever] - tags: - only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + - test: + context: + - org-global + - test-install-golang-prev: + context: + - org-global + - test-install-golang-current: + context: + - org-global + - test-install-golang-1.11-GOMODULE-on: + context: + - org-global + - dist: + filters: + tags: + only: /.*/ + - publish-packagecloud: + context: packagecloud + filters: + branches: + ignore: /.*/ + tags: + only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + requires: + - dist + - publish-github: + context: github-segmentcircle-oss-release + filters: + branches: + ignore: /.*/ + tags: + only: /v[0-9]+(\.[0-9]+)*(-[a-zA-Z0-9-]+)?/ + requires: + - dist + version: 2