From f29f12a63ee92cc0d569aadbedec158f4b39d31d Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Sat, 12 Sep 2020 20:39:34 +0000 Subject: [PATCH] runner: Fix logging slightly, add circleci --- .circleci/config.yml | 33 +++++++++++++++++++++++++++++++++ runner.mjs | 2 ++ uninstall.bat | 1 + 3 files changed, 36 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..d2ade9b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,33 @@ +version: 2 +jobs: + build: + docker: + - image: circleci/node:latest + working_directory: ~/app + steps: + - checkout + - run: + name: Install npm deployment app + command: sudo npm install -g github-release-cli + - run: + name: Check if this is a new release + command: | + echo test + - run: + name: Get current git commit message + command: | + echo "export COMMIT_MESSAGE=\"$(git log --format=oneline -n 1 $CIRCLE_SHA1)\"" >> $BASH_ENV + source $BASH_ENV + - deploy: + name: Create a release + command: | + PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[", ]//g') + echo "Packaging to ${CIRCLE_PROJECT_REPONAME}_build-sc.zip" + zip "${CIRCLE_PROJECT_REPONAME}_build-sc-core.zip" runner.mjs package.json service/* core/**/* core/* + +workflows: + version: 2 + build_deploy: + jobs: + - build: + context: github-thething diff --git a/runner.mjs b/runner.mjs index 5d1109d..919c77b 100644 --- a/runner.mjs +++ b/runner.mjs @@ -41,12 +41,14 @@ lowdb(util, log).then(async function(db) { try { await core.start('app') } catch (err) { + log.event.error('Unable to start app: ' + err.message) log.error(err, 'Unable to start app') errors++ } try { await core.start('manage') } catch (err) { + log.event.error('Unable to start manage: ' + err.message) log.error(err, 'Unable to start manage') errors++ } diff --git a/uninstall.bat b/uninstall.bat index 57cf518..203d9b1 100644 --- a/uninstall.bat +++ b/uninstall.bat @@ -1 +1,2 @@ node service\uninstall.mjs +PAUSE \ No newline at end of file