From 50848e013e10158cd92f84b64506777cbdd5438f Mon Sep 17 00:00:00 2001 From: karl anderson Date: Fri, 4 Oct 2019 19:59:18 +0000 Subject: [PATCH] add shipyard configuration files --- .base_branch | 1 + .circleci/config.yml | 126 +++++++++++++++++++++++++++++++++++++++++++ .shipyard.yml | 18 +++++++ 3 files changed, 145 insertions(+) create mode 100644 .base_branch create mode 100644 .circleci/config.yml create mode 100644 .shipyard.yml diff --git a/.base_branch b/.base_branch new file mode 100644 index 0000000..c6b3d5b --- /dev/null +++ b/.base_branch @@ -0,0 +1 @@ +origin/4.3 diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..04d5a5a --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,126 @@ +version: 2 + +workflows: + version: 2 + build_branch: + jobs: + - build_centos7 + + build_release: + jobs: + - build_centos7: + filters: + tags: + only: /^\d+\.\d+\.\d+$/ + branches: + ignore: /.*/ + +jobs: + build_centos7: + docker: + - image: offical2600hz/monster-ui-packager:1.0-centos-7 + user: circleci + shell: /bin/bash --login + working_directory: /home/circleci/2600hz/the_app + 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" + CORE_ROOT: "/home/circleci/2600hz/monster-ui" + BUILD_SOURCES: "/home/circleci/2600hz/packager/SOURCES" + BUILD_RPMS: "/home/circleci/2600hz/packager/RPMS" + APP_DIR: "/home/circleci/2600hz/the_app" + steps: + - checkout + - run: + name: Getting base branch + command: | + 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 Monster-UI repo (like origin/master) to '.base_branch' in your application root directory" + exit 1 + fi + - run: + name: Setting up Directories + command: | + APP=${CIRCLE_PROJECT_REPONAME#monster-ui-} + echo -e "export MONSTER_APP=${APP}\n" >> $BASH_ENV + echo -e "export APP=${APP}\n" >> $BASH_ENV + echo -e "export MONSTER_ROOT=${HOME}/2600hz/monster-ui" >> $BASH_ENV + echo -e "export APP_PATH=src/apps/${APP}\n\n" >> $BASH_ENV + - run: + name: Verify directories + command: | + echo ":: behold, running ci tests for application: $MONSTER_APP" + echo "MONSTER_ROOT: $MONSTER_ROOT" + echo "APP_PATH: $APP_PATH" + echo "BASE_BRANCH: $BASE_BRANCH" + if [ ! -d ${MONSTER_ROOT} ]; then + git clone https://github.com/2600hz/monster-ui $MONSTER_ROOT + fi + - run: + name: Running base setup script + command: ${MONSTER_ROOT}/scripts/circleci.bash + - restore_cache: + key: dependency-cache-centos-{{ checksum "/home/circleci/2600hz/monster-ui/package-lock.json" }} + paths: + -/home/circle/2600hz/monster-ui/node_modules + - run: + name: Install dependencies from package.json + command: | + cd $MONSTER_ROOT + npm install + - run: + name: Run a production build + command: | + cd $MONSTER_ROOT + gulp build-app --app=${APP} + - 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: Preparing source + command: | + cd $BUILD_ROOT + ./package_docs + cd $BUILD_SOURCES + echo " - copy build into artifacts" + cp -R ${MONSTER_ROOT}/dist/apps/${MONSTER_APP} ${BUILD_SOURCES}/ + echo " - generate build version and changelog" + 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 " - 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 package + command: | + cd $BUILD_ROOT + ./build + - store_artifacts: + path: /home/circleci/2600hz/packager/RPMS + - save_cache: + key: dependency-cache-centos-{{ checksum "/home/circleci/2600hz/monster-ui/package-lock.json" }} + paths: + - /home/circle/2600hz/monster-ui/node_modules + diff --git a/.shipyard.yml b/.shipyard.yml new file mode 100644 index 0000000..4ac7a4e --- /dev/null +++ b/.shipyard.yml @@ -0,0 +1,18 @@ +--- +name: monster-ui-application-voip +base_branch: origin/4.3 +metapackage: + - name: meta-monster-ui + branch: "4.3" + package: monster-ui-application-voip + type: required +base_core: monster-ui +template: monster-ui-application.spec.tmpl +package: + centos7: + name: monster-ui-application-voip + app_name: voip + license: "MPL 2.0" + group: Productivity/Telephony + url: http://www.2600hz.org/ + vendor: 2600Hz