Fix some bug in build. Also intentionally create bad build

This commit is contained in:
Jonatan Nilsson 2020-09-09 16:44:29 +00:00
parent ba12f8f59e
commit 13c2d3ac1a
5 changed files with 42 additions and 4 deletions

View file

@ -6,6 +6,11 @@ jobs:
working_directory: ~/app working_directory: ~/app
steps: steps:
- checkout - checkout
- 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
- run: - run:
name: Install npm deployment app name: Install npm deployment app
command: sudo npm install -g github-release-cli command: sudo npm install -g github-release-cli
@ -19,7 +24,7 @@ jobs:
command: | command: |
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[", ]//g') 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" echo "Packaging to ${CIRCLE_PROJECT_REPONAME}_build-sc.zip"
zip "${CIRCLE_PROJECT_REPONAME}_build-sc.zip" index.mjs package.json public api/** zip "${CIRCLE_PROJECT_REPONAME}_build-sc.zip" index.mjs package.json api/**/*
echo "Creating release '${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM}'" echo "Creating release '${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM}'"
github-release upload \ github-release upload \
--commitish $CIRCLE_SHA1 \ --commitish $CIRCLE_SHA1 \
@ -28,7 +33,7 @@ jobs:
--repo $CIRCLE_PROJECT_REPONAME \ --repo $CIRCLE_PROJECT_REPONAME \
--tag "v${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM}" \ --tag "v${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM}" \
--name "v${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM}" \ --name "v${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM}" \
--body "Automatic CircleCI Build of v${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM} from ${CIRCLE_SHA1}" \ --body "Automatic CircleCI Build of v${PACKAGE_VERSION}.${CIRCLE_BUILD_NUM} from ${CIRCLE_SHA1}: ${COMMIT_MESSAGE}" \
"${CIRCLE_PROJECT_REPONAME}_build-sc.zip" "${CIRCLE_PROJECT_REPONAME}_build-sc.zip"
workflows: workflows:

View file

@ -17,4 +17,10 @@ export default function coremonitor(io, config, db, log, core) {
logs: app.logs, logs: app.logs,
}) })
})) }))
core.on('managelog', safeWrap(log, 'coremonitor.on.managelog', function(manage) {
io.to('core.manage').emit('core.program.log', {
name: 'manage',
logs: manage.logs,
})
}))
} }

View file

@ -120,6 +120,19 @@ export async function listentoapp(ctx) {
}) })
} }
/*
* Event: 'core.listentomanage'
*
* Start listening to changes in core manage
*/
export async function listentomanage(ctx) {
ctx.socket.join('core.manage')
ctx.socket.emit('core.program.log', {
name: 'manage',
logs: ctx.core.getProgramLogs('manage')
})
}
/* /*
* Event: 'core.unlistentoapp' * Event: 'core.unlistentoapp'
* *
@ -128,3 +141,12 @@ export async function listentoapp(ctx) {
export async function unlistentoapp(ctx) { export async function unlistentoapp(ctx) {
ctx.socket.leave('core.app') ctx.socket.leave('core.app')
} }
/*
* Event: 'core.unlistentomanage'
*
* Stop listening to new log lines
*/
export async function unlistentomanage(ctx) {
ctx.socket.leave('core.manage')
}

View file

@ -80,7 +80,11 @@ const Updater = Module({
loadAppData() { loadAppData() {
this.updateActiveDb() this.updateActiveDb()
if (this.activeApp === 'app') { if (this.activeApp === 'app') {
socket.emit('core.unlistentomanage', {})
socket.emit('core.listentoapp', {}) socket.emit('core.listentoapp', {})
} else {
socket.emit('core.unlistentoapp', {})
socket.emit('core.listentomanage', {})
} }
/* request to listen to app updates */ /* request to listen to app updates */
}, },
@ -88,6 +92,7 @@ const Updater = Module({
remove: function() { remove: function() {
socket.emit('core.unlistencore', {}) socket.emit('core.unlistencore', {})
socket.emit('core.unlistentoapp', {}) socket.emit('core.unlistentoapp', {})
socket.emit('core.unlistentomanage', {})
}, },
startUpdate: function() { startUpdate: function() {
@ -113,7 +118,7 @@ const Updater = Module({
href: '/updater/app', href: '/updater/app',
}, 'Update App'), }, 'Update App'),
m(m.route.Link, { m(m.route.Link, {
hidden: this.manageRepository, hidden: !this.manageRepository,
class: 'button' + (this.activeApp === 'manage' ? ' active' : ''), class: 'button' + (this.activeApp === 'manage' ? ' active' : ''),
href: '/updater/manage', href: '/updater/manage',
}, 'Update Manager'), }, 'Update Manager'),

View file

@ -6,5 +6,5 @@
"managePort": 4271, "managePort": 4271,
"devPort": 4269, "devPort": 4269,
"appRepository": "thething/sc-helloworld", "appRepository": "thething/sc-helloworld",
"manageRepository": null "manageRepository": "TheThing/sc-manager"
} }