forked from cerc-io/laconic-console
Add back VERSION info.
This commit is contained in:
parent
48853538f3
commit
f5f117b890
@ -1,5 +1,5 @@
|
|||||||
name: dxos.network/console-app
|
name: dxos.network/console-app
|
||||||
displayName: DxOS Console Client
|
displayName: DxOS Console Client
|
||||||
build: yarn dist
|
build: yarn dist
|
||||||
version: 0.0.2
|
version: 0.0.3
|
||||||
package: QmPQX2Ti5fCnmKy4z8hzsGdEHKYWxiLSesRUtPj84w7L6L
|
package: QmQv4MGD9m6DTJtFJcoYM3b8bif16Tw7qoRhVgAj7dKo23
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import compareVersions from 'compare-versions';
|
import compareVersions from 'compare-versions';
|
||||||
|
import get from 'lodash.get';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useQuery } from '@apollo/react-hooks';
|
import { useQuery } from '@apollo/react-hooks';
|
||||||
import { makeStyles } from '@material-ui/core';
|
import { makeStyles } from '@material-ui/core';
|
||||||
@ -38,7 +39,7 @@ const VersionCheck = () => {
|
|||||||
const statusData = JSON.parse(statusRespone.system_status.json);
|
const statusData = JSON.parse(statusRespone.system_status.json);
|
||||||
const wnsData = JSON.parse(wnsResponse.wns_records.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;
|
let latest = current;
|
||||||
wnsData.forEach(({ attributes: { name, version } }) => {
|
wnsData.forEach(({ attributes: { name, version } }) => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"build": {
|
"build": {
|
||||||
"name": "@dxos/console-app",
|
"name": "@dxos/console-app",
|
||||||
"buildDate": "2020-06-12T03:31:58.883Z",
|
"buildDate": "2020-06-13T03:09:11.504Z",
|
||||||
"version": "1.0.0-beta.2"
|
"version": "1.0.0-beta.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// Copyright 2020 DxOS.org
|
// Copyright 2020 DxOS.org
|
||||||
//
|
//
|
||||||
|
|
||||||
|
import fs from 'fs';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import pick from 'lodash.pick';
|
import pick from 'lodash.pick';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
@ -23,6 +24,15 @@ const size = (n, unit) => {
|
|||||||
return num.format(Math.round(n / (10 ** power))) + (unit ? ` ${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.
|
* Get system inforamtion.
|
||||||
* https://www.npmjs.com/package/systeminformation
|
* https://www.npmjs.com/package/systeminformation
|
||||||
@ -74,6 +84,12 @@ const getSystemInfo = async () => {
|
|||||||
|
|
||||||
nodejs: {
|
nodejs: {
|
||||||
version: process.version
|
version: process.version
|
||||||
|
},
|
||||||
|
|
||||||
|
dxos: {
|
||||||
|
xbox: {
|
||||||
|
version: getVersionInfo()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -28,7 +28,13 @@ build: yarn dist
|
|||||||
version: $WNS_VERSION
|
version: $WNS_VERSION
|
||||||
EOF
|
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
|
if [ -d "dist/production" ]; then
|
||||||
yarn -s wire app publish --path './dist/production'
|
yarn -s wire app publish --path './dist/production'
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user