Skip to content

Commit

Permalink
CircleCI config updates (2600hz#5546)
Browse files Browse the repository at this point in the history
- update to new docker
- use erlang image
- run doc in separate executor
- update app circleci config
  • Loading branch information
icehess authored and jamesaimonetti committed Mar 1, 2019
1 parent d7cd44b commit 47a114c
Show file tree
Hide file tree
Showing 44 changed files with 2,884 additions and 2,860 deletions.
1 change: 1 addition & 0 deletions .base_branch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
origin/master
89 changes: 31 additions & 58 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ workflows:
- checks:
requires:
- build
- docs:
requires:
- build
- analyze:
requires:
- build
Expand All @@ -20,8 +23,7 @@ workflows:

defaults: &defaults
docker:
- image: circleci/build-image:ubuntu-14.04-XXL-upstart-1189-5614f37
command: /sbin/init
- image: offical2600hz/circleci:19.3.6.13
working_directory: ~/2600hz/kazoo
shell: /bin/bash --login
environment:
Expand All @@ -32,112 +34,83 @@ jobs:
<<: *defaults
steps:
- checkout
- run:
command: echo -e "export OTP_VERSION=$(<~/2600hz/kazoo/make/erlang_version)\nexport PATH=${HOME}/.kerl/\$OTP_VERSION/bin:${PATH}\n" >> $BASH_ENV
- restore_cache:
keys:
- erlang-v1-{{ checksum "make/erlang_version" }}
- run: echo -e "\n. ~/.kerl/$OTP_VERSION/activate\n" >> $BASH_ENV
- run:
command: bash ./scripts/circleci-build-erlang.sh
no_output_timeout: 1800s
- save_cache:
key: erlang-v1-{{ checksum "make/erlang_version" }}
paths:
- ~/.kerl
- ~/.local/
- run: echo -e "\nexport CHANGED=\$(git --no-pager diff --name-only HEAD origin/master -- applications core | xargs readlink -e)\nexport CHANGED_SWAGGER=`[[ ! -z $(git --no-pager diff --name-only HEAD origin/master -- applications/crossbar/priv/api/swagger.json) ]] && echo $(readlink -e applications/crossbar/priv/api/swagger.json)`\n" >> $BASH_ENV
- run: echo $CHANGED
- run: make changed
- persist_to_workspace:
root: .
paths:
- .
- persist_to_workspace:
root: ~/
paths:
- .kerl
build:
<<: *defaults
steps:
- attach_workspace:
at: .
- attach_workspace:
at: ~/
- restore_cache:
keys:
- deps-v1-{{ checksum "make/deps.mk" }}
- deps-v2-{{ checksum "make/deps.mk" }}
- run: make fmt
- run: JOBS="2" make
- save_cache:
key: deps-v1-{{ checksum "make/deps.mk" }}
key: deps-v2-{{ checksum "make/deps.mk" }}
paths:
- deps/
- persist_to_workspace:
root: .
paths:
- .
- persist_to_workspace:
root: ~/
paths:
- .kerl
checks:
<<: *defaults
steps:
- attach_workspace:
at: .
- attach_workspace:
at: ~/
- run: which ag >/dev/null 2>&1 || sudo apt-get update; sudo apt-get install silversearcher-ag
- run: sudo pip install --upgrade pip
- run: sudo pip install PyYAML mkdocs pyembed-markdown jsonschema

- run: ./scripts/state-of-docs.sh || true
- run: ./scripts/code_checks.bash $CHANGED
- run: make code_checks
- run: ./scripts/validate-js.sh $(find {core,applications}/*/priv/**/* -name *.json)
- run: make apis
- run: make app_applications
- run: make docs
- run: make validate-schemas
- run: ./scripts/state-of-edoc.escript
- run: make xref
- run: make sup_completion
- run: make elvis
- run: ${PWD}/scripts/check-unstaged.bash
analyze:

docs:
<<: *defaults
steps:
- attach_workspace:
at: .
- run: make apis
- run: make validate-js
- run: make validate-schemas
- run: make docs
- run: ./scripts/state-of-docs.sh || true
- run: ./scripts/state-of-edoc.escript
- run: ${PWD}/scripts/check-unstaged.bash

analyze:
<<: *defaults
steps:
- attach_workspace:
at: ~/
at: .
- restore_cache:
keys:
- plt-v1-{{ checksum "make/deps.mk" }}
- run: TO_DIALYZE="$(echo $CHANGED)" make build-plt dialyze
- plt-v2-{{ checksum "make/deps.mk" }}
- run: make build-plt dialyze-changed
- save_cache:
key: plt-v1-{{ checksum "make/deps.mk" }}
key: plt-v2-{{ checksum "make/deps.mk" }}
paths:
- .kazoo.plt

release:
<<: *defaults
docker:
- image: offical2600hz/circleci:19.3.6.13
- image: couchdb:2.1.1
- image: rabbitmq:3.7
environment:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
TZ: "/usr/share/zoneinfo/UTC"
docker:
- image: circleci/build-image:ubuntu-14.04-XXL-upstart-1189-5614f37
command: /sbin/init
- image: couchdb:2.1.1
- image: rabbitmq:3.7
- image: circleci/python:3.6.1
steps:
- attach_workspace:
at: .
- attach_workspace:
at: ~/
- run: mkdir -p $CIRCLE_ARTIFACTS
- run: . .kerl/*/activate && make build-ci-release
- run: . .kerl/*/activate && KAZOO_CONFIG=${PWD}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make release
- run: make build-ci-release
- run: KAZOO_CONFIG=${PWD}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make release
- run: cp ${PWD}/rel/ci.relx.config $CIRCLE_ARTIFACTS/
- run: find ${PWD}/_rel/kazoo/releases -name kazoo.rel -exec cp {} $CIRCLE_ARTIFACTS/ \;
- store_artifacts:
Expand Down
128 changes: 58 additions & 70 deletions .circleci/sequential.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,74 +8,62 @@ jobs:
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
TZ: "/usr/share/zoneinfo/UTC"
docker:
- image: circleci/build-image:ubuntu-14.04-XXL-upstart-1189-5614f37
command: /sbin/init
- image: couchdb:2.1.1
- image: rabbitmq:3.7
- image: circleci/python:3.6.1
- image: offical2600hz/circleci:19.3.6.13
- image: couchdb:2.1.1
- image: rabbitmq:3.7
steps:
- checkout
- run: mkdir -p $CIRCLE_ARTIFACTS
- run:
working_directory: ~/2600hz/kazoo
command: echo -e "export OTP_VERSION=$(<~/2600hz/kazoo/make/erlang_version)\nexport PATH=${HOME}/.kerl/\$OTP_VERSION/bin:${PATH}\n" >> $BASH_ENV
- restore_cache:
keys:
- v1-dep-{{ .Branch }}-
- v1-dep-master-
- v1-dep-
- run: echo -e "\n. ~/.kerl/$OTP_VERSION/activate\n" >> $BASH_ENV
- run:
command: bash ./scripts/circleci-build-erlang.sh
no_output_timeout: 1800s
- run: which ag >/dev/null 2>&1 || sudo apt-get update; sudo apt-get install silversearcher-ag
- run: sudo pip install --upgrade pip
- run: sudo pip install PyYAML mkdocs pyembed-markdown jsonschema
- save_cache:
key: v1-dep-{{ .Branch }}-{{ epoch }}
paths:
- ~/.kerl
- ~/.local/
- run: echo -e "\nexport CHANGED=\$(git --no-pager diff --name-only HEAD origin/master -- applications core | xargs readlink -e)\nexport CHANGED_SWAGGER=`[[ ! -z $(git --no-pager diff --name-only HEAD origin/master -- applications/crossbar/priv/api/swagger.json) ]] && echo $(readlink -e applications/crossbar/priv/api/swagger.json)`\n" >> $BASH_ENV
- run: echo $CHANGED
- run: ./scripts/state-of-docs.sh || true
- run: ./scripts/code_checks.bash $CHANGED
- restore_cache:
keys:
- deps-v1-{{ checksum "make/deps.mk" }}
- run: make fmt
- run: JOBS="2" make
- save_cache:
key: deps-v1-{{ checksum "make/deps.mk" }}
paths:
- deps/
- run: make code_checks
- run: make app_applications
- run: ./scripts/validate-js.sh $(find {core,applications}/*/priv/**/* -name *.json)
- run: make apis
- run: make docs
- run: make validate-schemas
- run: ./scripts/state-of-edoc.escript
- run: make xref
- run: make sup_completion
- restore_cache:
keys:
- plt-v1-{{ checksum "make/deps.mk" }}
- run: TO_DIALYZE="$(echo $CHANGED)" make build-plt dialyze
- save_cache:
key: plt-v1-{{ checksum "make/deps.mk" }}
paths:
- .kazoo.plt
- run: make elvis
- run: make build-ci-release
- run: ${PWD}/scripts/check-unstaged.bash
- run: KAZOO_CONFIG=${PWD}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make release
- run: cp ${PWD}/rel/ci.relx.config $CIRCLE_ARTIFACTS/
- run: find ${PWD}/_rel/kazoo/releases -name kazoo.rel -exec cp {} $CIRCLE_ARTIFACTS/ \;
- store_artifacts:
path: /tmp/circleci-artifacts
- run: |
if [[ $(grep -c -v -F 'exit with reason shutdown' ${CIRCLE_ARTIFACTS}/log/error.log) -gt 0 ]]; then
cat ${CIRCLE_ARTIFACTS}/log/error.log
exit 1
fi
- checkout
- run: make changed
- run: mkdir -p $CIRCLE_ARTIFACTS

# build sequence
- restore_cache:
keys:
- v2-dep-{{ .Branch }}-
- v2-dep-master-
- v2-dep-
- run: make fmt
- run: JOBS="2" make
- save_cache:
key: v2-dep-{{ .Branch }}-{{ epoch }}
paths:
- .deps

# code check sequence
- run: make code_checks
- run: make app_applications
- run: make sup_completion
- run: make xref
- run: make elvis

# docs sequence
- run: make apis
- run: make validate-js
- run: make validate-schemas
- run: make docs
- run: ./scripts/state-of-docs.sh || true
- run: ./scripts/state-of-edoc.escript

# analyze sequence
- restore_cache:
keys:
- plt-v2-{{ checksum "make/deps.mk" }}
- run: make build-plt dialyze-changed
- save_cache:
key: plt-v2-{{ checksum "make/deps.mk" }}
paths:
- .kazoo.plt

# release sequence
- run: make build-ci-release
- run: ${PWD}/scripts/check-unstaged.bash
- run: KAZOO_CONFIG=${PWD}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make release
- run: cp ${PWD}/rel/ci.relx.config $CIRCLE_ARTIFACTS/
- run: find ${PWD}/_rel/kazoo/releases -name kazoo.rel -exec cp {} $CIRCLE_ARTIFACTS/ \;
- store_artifacts:
path: /tmp/circleci-artifacts
- run: |
if [[ $(grep -c -v -F 'exit with reason shutdown' ${CIRCLE_ARTIFACTS}/log/error.log) -gt 0 ]]; then
cat ${CIRCLE_ARTIFACTS}/log/error.log
exit 1
fi
Loading

0 comments on commit 47a114c

Please sign in to comment.