Update CircleCI to use Makefile and cache Go dependencies
This commit is contained in:
@@ -26,40 +26,52 @@ jobs:
|
||||
build:
|
||||
working_directory: ~/alexanderzobnin/grafana-zabbix
|
||||
docker:
|
||||
- image: circleci/node:8
|
||||
- image: circleci/golang:1.13-node
|
||||
environment:
|
||||
YARN_NO_PROGRESS: "true"
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
keys:
|
||||
- dependency-cache-{{ checksum "yarn.lock" }}
|
||||
- dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||
- dependency-cache-go-{{ checksum "go.sum" }}
|
||||
- run:
|
||||
name: yarn install
|
||||
command: 'yarn install --pure-lockfile --no-progress'
|
||||
name: Install Dependencies
|
||||
command: 'make install'
|
||||
no_output_timeout: 15m
|
||||
- save_cache:
|
||||
key: dependency-cache-{{ checksum "yarn.lock" }}
|
||||
key: dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||
paths:
|
||||
- ./node_modules
|
||||
- run: npm run build
|
||||
- save_cache:
|
||||
key: dependency-cache-go-{{ checksum "go.sum" }}
|
||||
paths:
|
||||
- ./vendor
|
||||
- run: make build
|
||||
|
||||
lint:
|
||||
working_directory: ~/alexanderzobnin/grafana-zabbix
|
||||
docker:
|
||||
- image: circleci/node:8
|
||||
- image: circleci/golang:1.13-node
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
keys:
|
||||
- dependency-cache-{{ checksum "yarn.lock" }}
|
||||
- dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||
- dependency-cache-go-{{ checksum "go.sum" }}
|
||||
- run:
|
||||
name: yarn install
|
||||
command: 'yarn install --pure-lockfile --no-progress'
|
||||
name: Install Dependencies
|
||||
command: 'make install'
|
||||
no_output_timeout: 15m
|
||||
- save_cache:
|
||||
key: dependency-cache-{{ checksum "yarn.lock" }}
|
||||
key: dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||
paths:
|
||||
- ./node_modules
|
||||
- run: npm run lint
|
||||
- save_cache:
|
||||
key: dependency-cache-go-{{ checksum "go.sum" }}
|
||||
paths:
|
||||
- ./vendor
|
||||
- run: make lint
|
||||
|
||||
test:
|
||||
working_directory: ~/alexanderzobnin/grafana-zabbix
|
||||
@@ -67,7 +79,7 @@ jobs:
|
||||
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
|
||||
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
|
||||
docker:
|
||||
- image: circleci/node:8
|
||||
- image: circleci/golang:1.13-node
|
||||
steps:
|
||||
- checkout
|
||||
# Prepare for artifact and test results collection equivalent to how it was done on 1.0.
|
||||
@@ -76,16 +88,21 @@ jobs:
|
||||
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
|
||||
- restore_cache:
|
||||
keys:
|
||||
- dependency-cache-{{ checksum "yarn.lock" }}
|
||||
- dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||
- dependency-cache-go-{{ checksum "go.sum" }}
|
||||
- run:
|
||||
name: yarn install
|
||||
command: 'yarn install --pure-lockfile --no-progress'
|
||||
name: Install Dependencies
|
||||
command: 'make install'
|
||||
no_output_timeout: 15m
|
||||
- save_cache:
|
||||
key: dependency-cache-{{ checksum "yarn.lock" }}
|
||||
key: dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||
paths:
|
||||
- ./node_modules
|
||||
- run: npm run ci-test
|
||||
- save_cache:
|
||||
key: dependency-cache-go-{{ checksum "go.sum" }}
|
||||
paths:
|
||||
- ./vendor
|
||||
- run: make test-ci
|
||||
- store_test_results:
|
||||
path: /tmp/circleci-test-results
|
||||
- store_artifacts:
|
||||
@@ -96,7 +113,7 @@ jobs:
|
||||
make-release:
|
||||
working_directory: ~/alexanderzobnin/grafana-zabbix
|
||||
docker:
|
||||
- image: circleci/node:8
|
||||
- image: circleci/golang:1.13-node
|
||||
environment:
|
||||
CI_GIT_USER: CircleCI
|
||||
CI_GIT_EMAIL: ci@grafana.com
|
||||
@@ -107,15 +124,20 @@ jobs:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
keys:
|
||||
- dependency-cache-{{ checksum "yarn.lock" }}
|
||||
- dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||
- dependency-cache-go-{{ checksum "go.sum" }}
|
||||
- run:
|
||||
name: yarn install
|
||||
command: 'yarn install --pure-lockfile --no-progress'
|
||||
name: Install Dependencies
|
||||
command: 'make install'
|
||||
no_output_timeout: 15m
|
||||
- save_cache:
|
||||
key: dependency-cache-{{ checksum "yarn.lock" }}
|
||||
key: dependency-cache-npm-{{ checksum "yarn.lock" }}
|
||||
paths:
|
||||
- ./node_modules
|
||||
- save_cache:
|
||||
key: dependency-cache-go-{{ checksum "go.sum" }}
|
||||
paths:
|
||||
- ./vendor
|
||||
- run: ./.circleci/make-release.sh
|
||||
|
||||
build-docs:
|
||||
@@ -141,7 +163,7 @@ jobs:
|
||||
deploy-docs:
|
||||
working_directory: ~/grafana-zabbix
|
||||
docker:
|
||||
- image: circleci/node:8
|
||||
- image: circleci/golang:1.13-node
|
||||
environment:
|
||||
GH_PAGES_BRANCH: gh-pages
|
||||
CI_GIT_USER: CircleCI
|
||||
|
||||
@@ -29,7 +29,7 @@ RELEASE_BRANCH=release-$RELEASE_VER
|
||||
|
||||
# Build plugin
|
||||
git checkout -b $RELEASE_BRANCH
|
||||
yarn install --pure-lockfile && yarn build
|
||||
make clean install dist
|
||||
|
||||
# Commit release
|
||||
git add --force dist/
|
||||
|
||||
Reference in New Issue
Block a user