diff --git a/packages/console-app/app.yml b/packages/console-app/app.yml index abad9e8..4d1be99 100644 --- a/packages/console-app/app.yml +++ b/packages/console-app/app.yml @@ -1,5 +1,5 @@ name: dxos.network/console-app displayName: DxOS Console Client build: yarn dist -version: 0.0.2 -package: QmPQX2Ti5fCnmKy4z8hzsGdEHKYWxiLSesRUtPj84w7L6L +version: 0.0.3 +package: QmQv4MGD9m6DTJtFJcoYM3b8bif16Tw7qoRhVgAj7dKo23 diff --git a/packages/console-app/src/containers/VersionCheck.js b/packages/console-app/src/containers/VersionCheck.js index 0d1e2ce..623271d 100644 --- a/packages/console-app/src/containers/VersionCheck.js +++ b/packages/console-app/src/containers/VersionCheck.js @@ -3,6 +3,7 @@ // import compareVersions from 'compare-versions'; +import get from 'lodash.get'; import React, { useEffect, useState } from 'react'; import { useQuery } from '@apollo/react-hooks'; import { makeStyles } from '@material-ui/core'; @@ -38,7 +39,7 @@ const VersionCheck = () => { const statusData = JSON.parse(statusRespone.system_status.json); const wnsData = JSON.parse(wnsResponse.wns_records.json); - const { dxos: { image: current = '0.0.0' } = {} } = statusData; + const current = get(statusData, 'dxos.xbox.version', '0.0.0'); let latest = current; wnsData.forEach(({ attributes: { name, version } }) => { diff --git a/packages/console-app/src/version.json b/packages/console-app/src/version.json index c52cead..25cd8cb 100644 --- a/packages/console-app/src/version.json +++ b/packages/console-app/src/version.json @@ -1,7 +1,7 @@ { "build": { "name": "@dxos/console-app", - "buildDate": "2020-06-12T03:31:58.883Z", - "version": "1.0.0-beta.2" + "buildDate": "2020-06-13T03:09:11.504Z", + "version": "1.0.0-beta.3" } } diff --git a/packages/console-server/src/resolvers/system.js b/packages/console-server/src/resolvers/system.js index e00b07a..75fb27e 100644 --- a/packages/console-server/src/resolvers/system.js +++ b/packages/console-server/src/resolvers/system.js @@ -2,6 +2,7 @@ // Copyright 2020 DxOS.org // +import fs from 'fs'; import moment from 'moment'; import pick from 'lodash.pick'; import os from 'os'; @@ -23,6 +24,15 @@ const size = (n, unit) => { return num.format(Math.round(n / (10 ** power))) + (unit ? ` ${unit}` : ''); }; +const getVersionInfo = () => { + // TODO(telackey): Get from config (or figure out a better way to do this). + const versionFile = '/opt/xbox/VERSION'; + if (fs.existsSync(versionFile)) { + return fs.readFileSync(versionFile, { encoding: 'UTF8' }).replace(/^\s+|\s+$/g, '') + } + return undefined; +} + /** * Get system inforamtion. * https://www.npmjs.com/package/systeminformation @@ -74,6 +84,12 @@ const getSystemInfo = async () => { nodejs: { version: process.version + }, + + dxos: { + xbox: { + version: getVersionInfo() + } } }; }; diff --git a/scripts/deploy_apps_to_wns.sh b/scripts/deploy_apps_to_wns.sh index b91aaef..fbf9204 100755 --- a/scripts/deploy_apps_to_wns.sh +++ b/scripts/deploy_apps_to_wns.sh @@ -28,7 +28,13 @@ build: yarn dist version: $WNS_VERSION EOF - yarn -s wire app build + yarn clean + + # TODO(telackey): We need to fix `wire app build` not to bake in a path! + # In the meantime, use `yarn dist` which will not. + # yarn -s wire app build + yarn dist + if [ -d "dist/production" ]; then yarn -s wire app publish --path './dist/production' else