From 80211abed67f413fe0a73de1036f5916d748540d Mon Sep 17 00:00:00 2001 From: Hesaam Farhang Date: Fri, 1 Mar 2019 13:50:27 -0800 Subject: [PATCH] CircleCI updates (#5551) checkout base branch in circlec script use CHANGED env var if not empty fix and update apps cicrleci config battle of caches add dash invalidating deps cache update app's ci config copy pasta failed workflow for apps circleci which runs eunit tests too --- .circleci/config.yml | 11 +- .circleci/sequential.yml | 15 +- .circleci/workflows.yml | 11 +- Makefile | 10 +- applications/acdc/.circleci/config.yml | 187 +++++++++++++++--- applications/ananke/.circleci/config.yml | 187 +++++++++++++++--- applications/blackhole/.circleci/config.yml | 187 +++++++++++++++--- .../call_inspector/.circleci/config.yml | 187 +++++++++++++++--- applications/callflow/.circleci/config.yml | 187 +++++++++++++++--- applications/camper/.circleci/config.yml | 187 +++++++++++++++--- applications/cccp/.circleci/config.yml | 187 +++++++++++++++--- applications/cdr/.circleci/config.yml | 187 +++++++++++++++--- applications/conference/.circleci/config.yml | 187 +++++++++++++++--- applications/crossbar/.circleci/config.yml | 187 +++++++++++++++--- applications/doodle/.circleci/config.yml | 187 +++++++++++++++--- applications/dth/.circleci/config.yml | 187 +++++++++++++++--- applications/ecallmgr/.circleci/config.yml | 187 +++++++++++++++--- applications/edr/.circleci/config.yml | 187 +++++++++++++++--- applications/fax/.circleci/config.yml | 187 +++++++++++++++--- applications/frontier/.circleci/config.yml | 187 +++++++++++++++--- applications/hangups/.circleci/config.yml | 187 +++++++++++++++--- applications/hotornot/.circleci/config.yml | 187 +++++++++++++++--- applications/jonny5/.circleci/config.yml | 187 +++++++++++++++--- applications/konami/.circleci/config.yml | 187 +++++++++++++++--- applications/media_mgr/.circleci/config.yml | 187 +++++++++++++++--- applications/milliwatt/.circleci/config.yml | 187 +++++++++++++++--- applications/notify/.circleci/config.yml | 187 +++++++++++++++--- .../omnipresence/.circleci/config.yml | 187 +++++++++++++++--- applications/pivot/.circleci/config.yml | 187 +++++++++++++++--- applications/pusher/.circleci/config.yml | 187 +++++++++++++++--- applications/registrar/.circleci/config.yml | 187 +++++++++++++++--- applications/reorder/.circleci/config.yml | 187 +++++++++++++++--- applications/skel/.circleci/config.yml | 187 +++++++++++++++--- applications/spyvsspy/.circleci/config.yml | 187 +++++++++++++++--- applications/stats/.circleci/config.yml | 187 +++++++++++++++--- applications/stepswitch/.circleci/config.yml | 187 +++++++++++++++--- applications/sysconf/.circleci/config.yml | 187 +++++++++++++++--- applications/tasks/.circleci/config.yml | 187 +++++++++++++++--- applications/teletype/.circleci/config.yml | 187 +++++++++++++++--- applications/trunkstore/.circleci/config.yml | 187 +++++++++++++++--- applications/webhooks/.circleci/config.yml | 187 +++++++++++++++--- scripts/circleci.bash | 10 +- 42 files changed, 5815 insertions(+), 1161 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a70a2741292..9bb1e1e6348 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,13 +46,20 @@ jobs: at: . - restore_cache: keys: - - deps-v2-{{ checksum "make/deps.mk" }} + - deps-v3-{{ checksum "make/deps.mk" }} - run: make fmt + - run: | + deps_hash=$(md5sum make/deps.mk | cut -d" " -f1) + if [ x"$(cat .git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "make/.deps.mk.$deps_hash" + fi - run: JOBS="2" make + - run: echo -n $(md5sum make/deps.mk | cut -d" " -f1) > .git/.kz_deps_hash - save_cache: - key: deps-v2-{{ checksum "make/deps.mk" }} + key: deps-v3-{{ checksum "make/deps.mk" }} paths: - deps/ + - .git/.kz_deps_hash - persist_to_workspace: root: . paths: diff --git a/.circleci/sequential.yml b/.circleci/sequential.yml index 598ab0adee8..17e08a351c2 100644 --- a/.circleci/sequential.yml +++ b/.circleci/sequential.yml @@ -19,15 +19,20 @@ jobs: # build sequence - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- + - deps-v3-{{ checksum "make/deps.mk" }} - run: make fmt + - run: | + deps_hash=$(md5sum make/deps.mk | cut -d" " -f1) + if [ x"$(cat .git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "make/.deps.mk.$deps_hash" + fi - run: JOBS="2" make + - run: echo -n $(md5sum make/deps.mk | cut -d" " -f1) > .git/.kz_deps_hash - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} + key: deps-v3-{{ checksum "make/deps.mk" }} paths: - - .deps + - deps/ + - .git/.kz_deps_hash # code check sequence - run: make code_checks diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index a70a2741292..9bb1e1e6348 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -46,13 +46,20 @@ jobs: at: . - restore_cache: keys: - - deps-v2-{{ checksum "make/deps.mk" }} + - deps-v3-{{ checksum "make/deps.mk" }} - run: make fmt + - run: | + deps_hash=$(md5sum make/deps.mk | cut -d" " -f1) + if [ x"$(cat .git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "make/.deps.mk.$deps_hash" + fi - run: JOBS="2" make + - run: echo -n $(md5sum make/deps.mk | cut -d" " -f1) > .git/.kz_deps_hash - save_cache: - key: deps-v2-{{ checksum "make/deps.mk" }} + key: deps-v3-{{ checksum "make/deps.mk" }} paths: - deps/ + - .git/.kz_deps_hash - persist_to_workspace: root: . paths: diff --git a/Makefile b/Makefile index aa341cb3a45..f71e37e7d41 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,11 @@ ERLANG_MK_COMMIT = d30dda39b08e6ed9e12b44533889eaf90aba86de BASE_BRANCH := $(shell cat $(ROOT)/.base_branch) ## list files changed for more focused checks -CHANGED := $(shell git --no-pager diff --name-only HEAD $(BASE_BRANCH) -- applications core scripts) +ifeq ($(strip $(CHANGED)),) + CHANGED := $(shell git --no-pager diff --name-only HEAD $(BASE_BRANCH) -- applications core scripts) +else + CHANGED := $(CHANGED) +endif CHANGED_SWAGGER := $(shell git --no-pager diff --name-only HEAD $(BASE_BRANCH) -- applications/crossbar/priv/api/swagger.json) # You can override this when calling make, e.g. make JOBS=1 @@ -40,10 +44,10 @@ JOBS ?= 1 all: compile changed: - @git --no-pager diff --name-only HEAD $(BASE_BRANCH) -- applications core scripts + @echo "$(CHANGED)" changed_swagger: - @git --no-pager diff --name-only HEAD $(BASE_BRANCH) -- applications/crossbar/priv/api/swagger.json + @echo "$(CHANGED_SWAGGER)" compile: ACTION = all compile: deps kazoo diff --git a/applications/acdc/.circleci/config.yml b/applications/acdc/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/acdc/.circleci/config.yml +++ b/applications/acdc/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/ananke/.circleci/config.yml b/applications/ananke/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/ananke/.circleci/config.yml +++ b/applications/ananke/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/blackhole/.circleci/config.yml b/applications/blackhole/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/blackhole/.circleci/config.yml +++ b/applications/blackhole/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/call_inspector/.circleci/config.yml b/applications/call_inspector/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/call_inspector/.circleci/config.yml +++ b/applications/call_inspector/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/callflow/.circleci/config.yml b/applications/callflow/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/callflow/.circleci/config.yml +++ b/applications/callflow/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/camper/.circleci/config.yml b/applications/camper/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/camper/.circleci/config.yml +++ b/applications/camper/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/cccp/.circleci/config.yml b/applications/cccp/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/cccp/.circleci/config.yml +++ b/applications/cccp/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/cdr/.circleci/config.yml b/applications/cdr/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/cdr/.circleci/config.yml +++ b/applications/cdr/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/conference/.circleci/config.yml b/applications/conference/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/conference/.circleci/config.yml +++ b/applications/conference/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/crossbar/.circleci/config.yml b/applications/crossbar/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/crossbar/.circleci/config.yml +++ b/applications/crossbar/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/doodle/.circleci/config.yml b/applications/doodle/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/doodle/.circleci/config.yml +++ b/applications/doodle/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/dth/.circleci/config.yml b/applications/dth/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/dth/.circleci/config.yml +++ b/applications/dth/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/ecallmgr/.circleci/config.yml b/applications/ecallmgr/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/ecallmgr/.circleci/config.yml +++ b/applications/ecallmgr/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/edr/.circleci/config.yml b/applications/edr/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/edr/.circleci/config.yml +++ b/applications/edr/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/fax/.circleci/config.yml b/applications/fax/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/fax/.circleci/config.yml +++ b/applications/fax/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/frontier/.circleci/config.yml b/applications/frontier/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/frontier/.circleci/config.yml +++ b/applications/frontier/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/hangups/.circleci/config.yml b/applications/hangups/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/hangups/.circleci/config.yml +++ b/applications/hangups/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/hotornot/.circleci/config.yml b/applications/hotornot/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/hotornot/.circleci/config.yml +++ b/applications/hotornot/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/jonny5/.circleci/config.yml b/applications/jonny5/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/jonny5/.circleci/config.yml +++ b/applications/jonny5/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/konami/.circleci/config.yml b/applications/konami/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/konami/.circleci/config.yml +++ b/applications/konami/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/media_mgr/.circleci/config.yml b/applications/media_mgr/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/media_mgr/.circleci/config.yml +++ b/applications/media_mgr/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/milliwatt/.circleci/config.yml b/applications/milliwatt/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/milliwatt/.circleci/config.yml +++ b/applications/milliwatt/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/notify/.circleci/config.yml b/applications/notify/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/notify/.circleci/config.yml +++ b/applications/notify/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/omnipresence/.circleci/config.yml b/applications/omnipresence/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/omnipresence/.circleci/config.yml +++ b/applications/omnipresence/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/pivot/.circleci/config.yml b/applications/pivot/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/pivot/.circleci/config.yml +++ b/applications/pivot/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/pusher/.circleci/config.yml b/applications/pusher/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/pusher/.circleci/config.yml +++ b/applications/pusher/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/registrar/.circleci/config.yml b/applications/registrar/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/registrar/.circleci/config.yml +++ b/applications/registrar/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/reorder/.circleci/config.yml b/applications/reorder/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/reorder/.circleci/config.yml +++ b/applications/reorder/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/skel/.circleci/config.yml b/applications/skel/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/skel/.circleci/config.yml +++ b/applications/skel/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/spyvsspy/.circleci/config.yml b/applications/spyvsspy/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/spyvsspy/.circleci/config.yml +++ b/applications/spyvsspy/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/stats/.circleci/config.yml b/applications/stats/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/stats/.circleci/config.yml +++ b/applications/stats/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/stepswitch/.circleci/config.yml b/applications/stepswitch/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/stepswitch/.circleci/config.yml +++ b/applications/stepswitch/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/sysconf/.circleci/config.yml b/applications/sysconf/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/sysconf/.circleci/config.yml +++ b/applications/sysconf/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/tasks/.circleci/config.yml b/applications/tasks/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/tasks/.circleci/config.yml +++ b/applications/tasks/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/teletype/.circleci/config.yml b/applications/teletype/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/teletype/.circleci/config.yml +++ b/applications/teletype/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/trunkstore/.circleci/config.yml b/applications/trunkstore/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/trunkstore/.circleci/config.yml +++ b/applications/trunkstore/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/applications/webhooks/.circleci/config.yml b/applications/webhooks/.circleci/config.yml index fd379b96563..972a84b6109 100644 --- a/applications/webhooks/.circleci/config.yml +++ b/applications/webhooks/.circleci/config.yml @@ -1,47 +1,153 @@ version: 2 + +workflows: + version: 2 + build-analyze-run: + jobs: + - setup + - build_deps: + requires: + - setup + - build: + requires: + - build_deps + - eunit_tests: + requires: + - build_deps + - checks: + requires: + - build + - docs: + requires: + - build + - analyze: + requires: + - build + - release: + requires: + - build + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + shell: /bin/bash --login + working_directory: ~/2600hz/the_app + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + jobs: - build: - shell: /bin/bash --login - environment: - CIRCLE_ARTIFACTS: /tmp/circleci-artifacts - CIRCLE_TEST_REPORTS: /tmp/circleci-test-results - TZ: "/usr/share/zoneinfo/UTC" - docker: - - image: offical2600hz/circleci:19.3.6.13 - - image: couchdb:2.1.1 - - image: rabbitmq:3.7 + + # setup build environment sequence + setup: + <<: *defaults steps: + - checkout + # setup enviroment variable + - run: | + BAZE="$(cat "${HOME}/2600hz/the_app/.base_branch")" + if [ -n "$BAZE" ]; then + echo -e "\n\nexport BASE_BRANCH=$BAZE" >> $BASH_ENV + else + echo "add base branch name of main Kazoo repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi - run: | APP_DASH=${CIRCLE_PROJECT_REPONAME#kazoo-} APP=${APP_DASH/-/_} echo -e "export KAZOO_APP=${APP}\n" >> $BASH_ENV - - run: echo -e "export KAZOO_ROOT=${HOME}/${CIRCLE_PROJECT_USERNAME}/kazoo\nexport APP_PATH=applications/${KAZOO_APP}\n\n" >> $BASH_ENV + echo -e "export KAZOO_ROOT=${HOME}/2600hz/kazoo" >> $BASH_ENV + echo -e "export APP_PATH=applications/${APP}\n\n" >> $BASH_ENV + - run: | + echo ":: behold, running ci tests for application: $KAZOO_APP" + echo "KAZOO_ROOT: $KAZOO_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # setup build environment sequence - - checkout + # setup kazoo source code - run: | if [ ! -d ${KAZOO_ROOT} ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi - - run: mkdir -p $CIRCLE_ARTIFACTS - run: ${KAZOO_ROOT}/scripts/circleci.bash - - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done)"' >> $BASH_ENV + - run: echo -e 'export CHANGED="$(for file in `find ${KAZOO_ROOT}/applications/${KAZOO_APP} -name "*.[e|h]rl"`; do readlink -e $file; done | xargs echo)"' >> $BASH_ENV - run: echo $CHANGED + - persist_to_workspace: + root: ~/ + paths: + - 2600hz - # build sequence + # build deps sequence + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: TO_FMT="${CHANGED}" make -C ${KAZOO_ROOT} fmt - - run: JOBS="2" make -C ${KAZOO_ROOT} + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + deps_hash=$(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) + if [ x"$(cat $KAZOO_ROOT/.git/.kz_deps_hash)" = x"$deps_hash" ]; then + touch "$KAZOO_ROOT/make/.deps.mk.$deps_hash" + fi + - run: echo -n $(md5sum $KAZOO_ROOT/make/deps.mk | cut -d" " -f1) > "$KAZOO_ROOT/.git/.kz_deps_hash" + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} - paths: - - ${KAZOO_ROOT}/.deps + key: deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + paths: + - ~/2600hz/kazoo/deps/ + - ~/2600hz/kazoo/.git/.kz_deps_hash + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # build sequence + build: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: make -C ${KAZOO_ROOT} fmt + - run: JOBS="2" make -C ${KAZOO_ROOT} + - persist_to_workspace: + root: ~/ + paths: + - 2600hz + + # eunit_tests sequence + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: ~/ + - restore_cache: + keys: + - deps-v3.1-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - run: | + md5sum $KAZOO_ROOT/make/deps.mk || true + ls -al $KAZOO_ROOT/make || true + - run: ERLC_OPTS='-DPROPER' make -C ${KAZOO_ROOT}/core compile-test + - run: make -C "$KAZOO_ROOT/$APP_PATH" eunit - # code checks sequence + # code checks sequence + checks: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} code_checks - run: ${KAZOO_ROOT}/scripts/code_checks.bash $CHANGED - run: make -C ${KAZOO_ROOT} app_applications @@ -49,7 +155,12 @@ jobs: - run: make -C ${KAZOO_ROOT} xref - run: make -C ${KAZOO_ROOT} elvis - # docs sequence + # docs sequence + docs: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} apis - run: make -C ${KAZOO_ROOT} validate-js - run: make -C ${KAZOO_ROOT} validate-schemas @@ -57,17 +168,31 @@ jobs: - run: ${KAZOO_ROOT}/scripts/state-of-docs.sh || true - run: ${KAZOO_ROOT}/scripts/state-of-edoc.escript - # analyze sequence + # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: ~/ - restore_cache: keys: - - plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + - plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} - run: TO_DIALYZE="$(echo $CHANGED)" make -C ${KAZOO_ROOT} build-plt dialyze - save_cache: - key: plt-v2-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} + key: plt-v3-{{ checksum "~/2600hz/kazoo/make/deps.mk" }} paths: - - ${KAZOO_ROOT}/.kazoo.plt + - ~/2600hz/kazoo/.kazoo.plt - # release sequence + # release sequence + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + steps: + - attach_workspace: + at: ~/ - run: make -C ${KAZOO_ROOT} build-ci-release - run: ${KAZOO_ROOT}/scripts/check-unstaged.bash - run: KAZOO_CONFIG=${KAZOO_ROOT}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make -C ${KAZOO_ROOT} release diff --git a/scripts/circleci.bash b/scripts/circleci.bash index 1abd51a9eba..7eb7c06a34d 100755 --- a/scripts/circleci.bash +++ b/scripts/circleci.bash @@ -5,11 +5,17 @@ if [ ! -d $KAZOO_ROOT ]; then git clone https://github.com/2600hz/kazoo $KAZOO_ROOT fi +if [ -f "$HOME/project/.base_branch" ]; then + BASE_BRANCH="$(cat $HOME/project/.base_branch)" +else + BASE_BRANCH="origin/master" +fi + cd $KAZOO_ROOT -echo resetting kazoo to origin/master +echo resetting kazoo to $BASE_BRANCH git fetch --prune -git rebase origin/master +git rebase $BASE_BRANCH if [ ! -d $APP_PATH ]; then echo adding submodule to $KAZOO_ROOT