Add back VERSION info.

This commit is contained in:
Thomas E Lackey 2020-06-12 23:30:50 -05:00
parent 48853538f3
commit f5f117b890
5 changed files with 29 additions and 6 deletions

View File

@ -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

View File

@ -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 } }) => {

View File

@ -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"
}
}

View File

@ -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()
}
}
};
};

View File

@ -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