diff --git a/.circleci/config.yml b/.circleci/config.yml index b610f33db9b..96ff1a3cb09 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,75 +2,385 @@ version: 2 workflows: version: 2 - build-analyze-run: + + build-branch: jobs: - - build - + - 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 + - build_centos7: + requires: + - build + - eunit_tests + - checks + - docs + - analyze + - release + + build_release: + jobs: + - setup: + filters: + tags: + only: /^\d+\.\d+\.\d+$/ + branches: + ignore: /.*/ + - build_deps: + filters: + tags: + only: /^\d+\.\d+\.\d+$/ + branches: + ignore: /.*/ + requires: + - setup + - build: + filters: + tags: + only: /^\d+\.\d+\.\d+$/ + branches: + ignore: /.*/ + requires: + - build_deps + - eunit_tests: + filters: + tags: + only: /^\d+\.\d+\.\d+$/ + branches: + ignore: /.*/ + requires: + - build_deps + - checks: + filters: + tags: + only: /^\d+\.\d+\.\d+$/ + branches: + ignore: /.*/ + requires: + - build + - docs: + filters: + tags: + only: /^\d+\.\d+\.\d+$/ + branches: + ignore: /.*/ + requires: + - build + - analyze: + filters: + tags: + only: /^\d+\.\d+\.\d+$/ + branches: + ignore: /.*/ + requires: + - build + - release: + filters: + tags: + only: /^\d+\.\d+\.\d+$/ + branches: + ignore: /.*/ + requires: + - build + - build_centos7: + filters: + tags: + only: /^\d+\.\d+\.\d+$/ + branches: + ignore: /.*/ + requires: + - build + - eunit_tests + - checks + - docs + - analyze + - release + +defaults: &defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + working_directory: ~/2600hz/kazoo + shell: /bin/bash --login + environment: + BASH_ENV: ".git/.bashrc" + jobs: - build: - working_directory: ~/2600hz/kazoo - 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: + <<: *defaults steps: - checkout - - run: make changed - - run: mkdir -p $CIRCLE_ARTIFACTS - - # build sequence + - run: + name: Listing Changes + command: make changed + - persist_to_workspace: + root: . + paths: + - . + + build_deps: + <<: *defaults + steps: + - attach_workspace: + at: . - restore_cache: keys: - - v2-dep-{{ .Branch }}- - - v2-dep-master- - - v2-dep- - - run: make fmt - - run: JOBS="2" make + - deps-v3.2-{{ checksum "make/deps.mk" }} + - run: + name: Making deps + command: make deps - save_cache: - key: v2-dep-{{ .Branch }}-{{ epoch }} + key: deps-v3.2-{{ checksum "make/deps.mk" }} paths: - - .deps + - deps/ + - persist_to_workspace: + root: . + paths: + - . + + build: + <<: *defaults + steps: + - attach_workspace: + at: . + - restore_cache: + keys: + - deps-v3.2-{{ checksum "make/deps.mk" }} + - run: + name: Compiling the project + command: JOBS="2" make + - save_cache: + key: deps-v3.2-{{ checksum "make/deps.mk" }} + paths: + - deps/ + - persist_to_workspace: + root: . + paths: + - . + + eunit_tests: + <<: *defaults + steps: + - attach_workspace: + at: . + - restore_cache: + keys: + - deps-v3.2-{{ checksum "make/deps.mk" }} + - run: + name: Displaying deps hash + command: | + md5sum make/deps.mk || true + ls -al make || true + - run: + name: Compiling for unit test enviornment + command: ERLC_OPTS='-DPROPER' make compile-test + - run: + name: Running Eunit tests + command: make eunit - # code check sequence - - run: make code_checks - - run: make app_applications - - run: make sup_completion - - run: make xref - - run: make elvis + + checks: + <<: *defaults + steps: + - attach_workspace: + at: . + - run: + name: Running code checks + command: make code_checks + - run: + name: Running additional code checks + command: scripts/code_checks.bash + - run: + name: Making app applications + command: make app_applications + - run: + name: Generating sup bash completion file + command: make sup_completion + - run: + name: Running xref check + command: make xref + - run: + name: Running code style check + command: make elvis + - run: + name: Checking for unstaged files + command: scripts/check-unstaged.bash - # docs sequence - - run: make apis - - run: make validate-js - - run: make validate-schemas - - run: make docs - - run: ./scripts/state-of-docs.sh || true - - run: ./scripts/state-of-edoc.escript + docs: + <<: *defaults + steps: + - attach_workspace: + at: . + - run: + name: Generating APIs + command: make apis + - run: + name: Validating view JS + command: make validate-js + - run: + name: Validating schemas + command: make validate-schemas + - run: + name: Generating docs + command: make docs || true + - run: + name: Checking doc states + command: scripts/state-of-docs.sh || true + - run: + name: Validating doc states + command: scripts/state-of-edoc.escript + - run: + name: Checking for unstaged files + command: scripts/check-unstaged.bash - # analyze sequence + analyze: + <<: *defaults + steps: + - attach_workspace: + at: . - restore_cache: keys: - plt-v2-{{ checksum "make/deps.mk" }} - - run: make build-plt dialyze-changed + - run: + name: Running dailyzer checks + command: make build-plt dialyze-changed - save_cache: key: plt-v2-{{ checksum "make/deps.mk" }} paths: - .kazoo.plt - # release sequence - - run: make build-ci-release - - run: ${PWD}/scripts/check-unstaged.bash - - run: KAZOO_CONFIG=${PWD}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make release - - run: cp ${PWD}/rel/ci.relx.config $CIRCLE_ARTIFACTS/ - - run: find ${PWD}/_rel/kazoo/releases -name kazoo.rel -exec cp {} $CIRCLE_ARTIFACTS/ \; + release: + <<: *defaults + docker: + - image: offical2600hz/circleci:19.3.6.13 + - image: couchdb:2.1.1 + - image: rabbitmq:3.7 + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + TZ: "/usr/share/zoneinfo/UTC" + steps: + - attach_workspace: + at: . + - run: + name: Creating artifacts directory + command: mkdir -p $CIRCLE_ARTIFACTS + - run: + name: Making CI release + command: make build-ci-release + - run: + name: Making release + command: KAZOO_CONFIG=${PWD}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make release + - run: + name: Copying artifacts + command: cp ${PWD}/rel/ci.relx.config $CIRCLE_ARTIFACTS/ + - run: + name: Finding Artifacts + command: find ${PWD}/_rel/kazoo/releases -name kazoo.rel -exec cp {} $CIRCLE_ARTIFACTS/ \; - store_artifacts: path: /tmp/circleci-artifacts - - run: | - if [[ $(grep -c -v -F 'exit with reason shutdown' ${CIRCLE_ARTIFACTS}/log/error.log) -gt 0 ]]; then - cat ${CIRCLE_ARTIFACTS}/log/error.log - exit 1 - fi + - run: + name: Checking for errors + command: | + if [[ $(grep -c -v -F 'exit with reason shutdown' ${CIRCLE_ARTIFACTS}/log/error.log) -gt 0 ]]; then + cat ${CIRCLE_ARTIFACTS}/log/error.log + exit 1 + fi + + build_centos7: + docker: + - image: offical2600hz/kazoo-packager-19:1.0-centos-7 + user: circleci + shell: /bin/bash --login + working_directory: /home/circleci/2600hz/kazoo + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + BASH_ENV: "/home/circleci/2600hz/.bashrc" + BUILD_ROOT: "/home/circleci/2600hz/packager" + KAZOO_ROOT: "/home/circleci/2600hz/kazoo" + BUILD_SOURCES: "/home/circleci/2600hz/packager/SOURCES" + BUILD_RPMS: "/home/circleci/2600hz/packager/RPMS" + APP_DIR: "/home/circleci/2600hz/kazoo" + steps: + - checkout + - restore_cache: + keys: + - deps-centos7-v3.2-{{ checksum "make/deps.mk" }} + - run: + name: Making dependencies + command: | + md5sum make/deps.mk || true + ls -al make || true + make deps + - save_cache: + key: deps-centos7-v3.2-{{ checksum "make/deps.mk" }} + paths: + - deps/ + - .git/.kz_deps_hash + - run: + name: Generating version info + command: | + cd $BUILD_ROOT + VERSION=$(./version) + RELEASE=$(./release) + PACKAGE_NAME=$(./package_name) + echo "export PACKAGE_NAME=${PACKAGE_NAME}" >> $BASH_ENV + echo "export VERSION=${VERSION}" >> $BASH_ENV + echo "export RELEASE=${RELEASE}" >> $BASH_ENV + PACKAGE_NAME=$(./package_name) + echo "export PACKAGE_NAME=${PACKAGE_NAME}" >> $BASH_ENV + echo "build version for ${PACKAGE_NAME} version: ${VERSION} release: ${RELEASE}" + - run: + name: Building release + command: | + cd $KAZOO_ROOT + make all KZ_VERSION=$VERSION.$RELEASE + make build-release KZ_VERSION=$VERSION.$RELEASE + make sup_completion + - run: + name: Preparing source for packaging + command: | + cd $BUILD_ROOT + echo " - generate build version and changelog" + ./package_docs + cd $BUILD_SOURCES + echo " - removing files that should not be packaged in the source tar" + rm -rf ${BUILD_SOURCES}/.??* + rm -rf ${BUILD_SOURCES}/doc* + rm -rf ${BUILD_SOURCES}/*.md + echo " - preparing apps" + rm -rf _rel/kazoo/lib/skel-* + cp -R ${KAZOO_ROOT}/_rel ${BUILD_SOURCES}/ + cp ${KAZOO_ROOT}/sup.bash ${BUILD_SOURCES}/ + cp ${KAZOO_ROOT}/LICENSE ${BUILD_SOURCES}/ + echo " - creating the source tar" + cd $BUILD_ROOT + ARTIFACTS_NAME=${PACKAGE_NAME}-${VERSION} + mkdir -p ${ARTIFACTS_NAME} + cp -r ${BUILD_SOURCES}/* ${ARTIFACTS_NAME}/. + tar -cf ${ARTIFACTS_NAME}.tar ${ARTIFACTS_NAME} + cp ${ARTIFACTS_NAME}.tar ${BUILD_SOURCES}/. + - run: + name: Building RPM packages + command: | + cd $BUILD_ROOT + ./build + - store_artifacts: + path: /home/circleci/2600hz/packager/RPMS diff --git a/.shipyard.yml b/.shipyard.yml new file mode 100644 index 00000000000..09493bb1057 --- /dev/null +++ b/.shipyard.yml @@ -0,0 +1,465 @@ +--- +name: kazoo +base_branch: +base_core: +template: kazoo-core.spec.tmpl +metapackage: + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-core + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-acdc + - + name: meta-kazoo-applications + type: related + branch: "4.3" + package: kazoo-application-ananke + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-blackhole + - + name: meta-kazoo-applications + type: related + branch: "4.3" + package: kazoo-application-braintree + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-call_inspector + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-callflow + - + name: meta-kazoo-applications + type: related + branch: "4.3" + package: kazoo-application-camper + - + name: meta-kazoo-applications + type: related + branch: "4.3" + package: kazoo-application-cccp + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-cdr + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-conference + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-crossbar + - + name: meta-kazoo-applications + type: related + branch: "4.3" + package: kazoo-application-doodle + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-ecallmgr + - + name: meta-kazoo-applications + type: related + branch: "4.3" + package: kazoo-application-edr + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-fax + - + name: meta-kazoo-applications + type: related + branch: "4.3" + package: kazoo-application-frontier + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-hangups + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-hotornot + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-jonny5 + - + name: meta-kazoo-applications + type: related + branch: "4.3" + package: kazoo-application-konami + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-media_mgr + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-milliwatt + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-notify + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-omnipresence + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-pivot + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-pusher + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-registrar + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-reorder + - + name: meta-kazoo-applications + type: related + branch: "4.3" + package: kazoo-application-spyvsspy + - + name: meta-kazoo-applications + type: related + branch: "4.3" + package: kazoo-application-stats + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-stepswitch + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-sysconf + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-tasks + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-teletype + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-trunkstore + - + name: meta-kazoo-applications + type: required + branch: "4.3" + package: kazoo-application-webhooks +package: + centos7: + summary: "2600hz Kazoo communications platform core" + description: | + Kazoo, an ambitious project to bring cloud-based VoIP + and telecommunications to everyone. Our goal is to + provide the world with a free, open telecommunications + software platform. Released under the OSI-approved + MPL 2.0 open source software license, we're building + upon strong FOSS components like GNU/Linux, Erlang, + FreeSWITCH, Apache CouchDB, and RabbitMQ. Our project + is a great example of the wonderful things that can + happen when software is open. If you need help you + can contact us via the dev mailing list or on IRC + at #2600hz on FreeNode. + dist: .el7.centos + name: kazoo-core + license: MPL 2.0 + group: Productivity/Telephony + url: http://www.2600hz.org/ + vendor: 2600hz + subpackages: + - + name: kazoo-application-acdc + app_name: acdc + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-ananke + app_name: ananke + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-blackhole + app_name: blackhole + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-braintree + app_name: braintree + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-call_inspector + app_name: call_inspector + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-callflow + app_name: callflow + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-camper + app_name: camper + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-cccp + app_name: cccp + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-cdr + app_name: cdr + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-conference + app_name: conference + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-crossbar + app_name: crossbar + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-doodle + app_name: doodle + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-ecallmgr + app_name: ecallmgr + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-edr + app_name: edr + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-fax + app_name: fax + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-frontier + app_name: frontier + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-hangups + app_name: hangups + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-hotornot + app_name: hotornot + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-jonny5 + app_name: jonny5 + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-konami + app_name: konami + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-media_mgr + app_name: media_mgr + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-milliwatt + app_name: milliwatt + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-notify + app_name: notify + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-omnipresence + app_name: omnipresence + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-pivot + app_name: pivot + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-pusher + app_name: pusher + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-registrar + app_name: registrar + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-reorder + app_name: reorder + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-spyvsspy + app_name: spyvsspy + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-stats + app_name: stats + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-stepswitch + app_name: stepswitch + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-sysconf + app_name: sysconf + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-tasks + app_name: tasks + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-teletype + app_name: teletype + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-trunkstore + app_name: trunkstore + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode. + - + name: kazoo-application-webhooks + app_name: webhooks + summary: Kazoo core application + description: | + If you need help you can contact us via the dev mailing + list or on IRC at #2600hz on FreeNode.