From 8ff9121ee5d5f7703c6890f86ef35a750e248eee Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 21 Aug 2019 19:10:28 +0300 Subject: [PATCH 1/2] circleci: update config to include cli and docker builds Merges old config into the new one, closes #306. --- .circleci/config.yml | 38 ++++++++++++ circle.yml | 140 ------------------------------------------- 2 files changed, 38 insertions(+), 140 deletions(-) delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index c4c2ca127..0731e969d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,6 +62,34 @@ jobs: - gomod - run: go test -v -race ./... + build_cli: + working_directory: /go/src/github.com/CityOfZion/neo-go + executor: go1_12 + steps: + - checkout + - gomod + - run: make build + + build_image: + working_directory: /go/src/github.com/CityOfZion/neo-go + executor: go1_12 + docker: + - image: alpine + steps: + - run: apk update && apk add git make curl tar + - checkout + - setup_remote_docker + - run: + name: Install Docker client + command: | + set -x + VER="17.03.0-ce" + curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz + tar -xz -C /tmp -f /tmp/docker-$VER.tgz + mv /tmp/docker/* /usr/bin + - run: make build-image + + workflows: version: 2.1 workflow: @@ -82,3 +110,13 @@ workflows: filters: tags: only: /[0-9]+\.[0-9]+\.[0-9]+/ + - build_cli: + filters: + tags: + only: /[0-9]+\.[0-9]+\.[0-9]+/ + - build_image: + requires: + - build_cli + filters: + tags: + only: /[0-9]+\.[0-9]+\.[0-9]+/ diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 2872afeda..000000000 --- a/circle.yml +++ /dev/null @@ -1,140 +0,0 @@ -version: 2 -jobs: - install_deps: - working_directory: /go/src/github.com/CityOfZion/neo-go - docker: - - image: vidsyhq/go-builder:latest - environment: - BUILD: false - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "Gopkg.toml" }}-{{ checksum "Gopkg.lock" }} - - run: /scripts/build.sh - - save_cache: - key: dependency-cache-{{ checksum "Gopkg.toml" }}-{{ checksum "Gopkg.lock" }} - paths: - - vendor - - /go/pkg - build_image: - working_directory: /go/src/github.com/CityOfZion/neo-go - docker: - - image: alpine - steps: - - run: apk update && apk add git make curl tar - - checkout - - restore_cache: - keys: - - dependency-cache-{{ .Revision }} - - restore_cache: - keys: - - dependency-cache-cli-{{ checksum "Gopkg.toml" }}-{{ checksum "Gopkg.lock" }} - - setup_remote_docker - - run: - name: Install Docker client - command: | - set -x - VER="17.03.0-ce" - curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz - tar -xz -C /tmp -f /tmp/docker-$VER.tgz - mv /tmp/docker/* /usr/bin - - run: make build-image - test: - working_directory: /go/src/github.com/CityOfZion/neo-go - docker: - - image: vidsyhq/go-builder:latest - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "Gopkg.toml" }}-{{ checksum "Gopkg.lock" }} - - run: make test - vet: - working_directory: /go/src/github.com/CityOfZion/neo-go - docker: - - image: vidsyhq/go-builder:latest - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "Gopkg.toml" }}-{{ checksum "Gopkg.lock" }} - - run: make vet - build_cli: - working_directory: /go/src/github.com/CityOfZion/neo-go - docker: - - image: vidsyhq/go-builder:latest - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "Gopkg.toml" }}-{{ checksum "Gopkg.lock" }} - - run: make build - - save_cache: - key: dependency-cache-cli-{{ checksum "Gopkg.toml" }}-{{ checksum "Gopkg.lock" }} - paths: - - bin/neo-go - deploy: - working_directory: /go/src/github.com/CityOfZion/neo-go - docker: - - image: alpine - steps: - - run: apk update && apk add git make curl tar - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "Gopkg.toml" }}-{{ checksum "Gopkg.lock" }} - - restore_cache: - key: dependency-cache-cli-{{ checksum "Gopkg.toml" }}-{{ checksum "Gopkg.lock" }} - - setup_remote_docker - - run: - name: Install Docker client - command: | - set -x - VER="17.03.0-ce" - curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz - tar -xz -C /tmp -f /tmp/docker-$VER.tgz - mv /tmp/docker/* /usr/bin - - run: make build-image - - deploy: - name: deploy - command: make push-to-registry -workflows: - version: 2 - workflow: - jobs: - - install_deps: - filters: - tags: - only: /[0-9]+\.[0-9]+\.[0-9]+/ - - test: - requires: - - install_deps - filters: - tags: - only: /[0-9]+\.[0-9]+\.[0-9]+/ - - vet: - requires: - - install_deps - filters: - tags: - only: /[0-9]+\.[0-9]+\.[0-9]+/ - - build_cli: - requires: - - install_deps - filters: - tags: - only: /[0-9]+\.[0-9]+\.[0-9]+/ - - build_image: - requires: - - install_deps - - build_cli - filters: - tags: - only: /[0-9]+\.[0-9]+\.[0-9]+/ - - deploy: - requires: - - build_image - - test - - vet - filters: - tags: - only: - - /[0-9]+\.[0-9]+\.[0-9]+/ - branches: - ignore: /.*/ \ No newline at end of file From 16e0fcde1f229720da51881bf794ec78edc99e78 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 21 Aug 2019 20:02:43 +0300 Subject: [PATCH 2/2] circleci: update tag specs in workflows Use go-style version tags as suggested by @im-kulikov. --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0731e969d..0723232c6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -97,26 +97,26 @@ workflows: - vet: filters: tags: - only: /[0-9]+\.[0-9]+\.[0-9]+/ + only: v/[0-9]+\.[0-9]+\.[0-9]+/ - lint: filters: tags: - only: /[0-9]+\.[0-9]+\.[0-9]+/ + only: v/[0-9]+\.[0-9]+\.[0-9]+/ - test_1_11: filters: tags: - only: /[0-9]+\.[0-9]+\.[0-9]+/ + only: v/[0-9]+\.[0-9]+\.[0-9]+/ - test_1_12: filters: tags: - only: /[0-9]+\.[0-9]+\.[0-9]+/ + only: v/[0-9]+\.[0-9]+\.[0-9]+/ - build_cli: filters: tags: - only: /[0-9]+\.[0-9]+\.[0-9]+/ + only: v/[0-9]+\.[0-9]+\.[0-9]+/ - build_image: requires: - build_cli filters: tags: - only: /[0-9]+\.[0-9]+\.[0-9]+/ + only: v/[0-9]+\.[0-9]+\.[0-9]+/