From: Ward Vandewege Date: Sun, 2 Jun 2019 17:23:29 +0000 (-0400) Subject: If a version number is supplied to the build command, make sure to report that X-Git-Tag: 1.4.1~1 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/2f9771027fa0b1096b1eb8d450d7abf95356ee20 If a version number is supplied to the build command, make sure to report that version number in the web interface (top left). No issue # Arvados-DCO-1.1-Signed-off-by: Ward Vandewege --- diff --git a/package.json b/package.json index 0e5805a3..68d23bfa 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ }, "scripts": { "start": "react-scripts-ts start", - "build": "REACT_APP_BUILD_NUMBER=$BUILD_NUMBER REACT_APP_GIT_COMMIT=$GIT_COMMIT react-scripts-ts build", + "build": "REACT_APP_VERSION=$VERSION REACT_APP_BUILD_NUMBER=$BUILD_NUMBER REACT_APP_GIT_COMMIT=$GIT_COMMIT react-scripts-ts build", "build-local": "react-scripts-ts build", "test": "CI=true react-scripts-ts test --env=jsdom", "test-local": "react-scripts-ts test --env=jsdom", diff --git a/src/common/app-info.ts b/src/common/app-info.ts index cd274835..de6708eb 100644 --- a/src/common/app-info.ts +++ b/src/common/app-info.ts @@ -3,7 +3,11 @@ // SPDX-License-Identifier: AGPL-3.0 export const getBuildInfo = (): string => { - const getBuildNumber = "BN-" + (process.env.REACT_APP_BUILD_NUMBER || "dev"); - const getGitCommit = "GIT-" + (process.env.REACT_APP_GIT_COMMIT || "latest").substr(0, 7); - return getBuildNumber + " / " + getGitCommit; -}; \ No newline at end of file + if (process.env.REACT_APP_VERSION) { + return "v" + process.env.REACT_APP_VERSION; + } else { + const getBuildNumber = "BN-" + (process.env.REACT_APP_BUILD_NUMBER || "dev"); + const getGitCommit = "GIT-" + (process.env.REACT_APP_GIT_COMMIT || "latest").substr(0, 7); + return getBuildNumber + " / " + getGitCommit; + } +};