[MM-37055] Remove commit hash from release builds generated by CircleCI (#1750) (#1760)

(cherry picked from commit e8523067b0)

Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
This commit is contained in:
Mattermost Build 2021-09-23 15:33:48 +02:00 committed by GitHub
parent 73b8d47172
commit 44456a1b85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 4 deletions

View file

@ -19,7 +19,7 @@ function createErrorReport(err: Error) {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
return `Application: ${app.name} ${app.getVersion()} [commit: ${__HASH_VERSION__}]\n` + return `Application: ${app.name} ${app.getVersion()}${__HASH_VERSION__ ? ` [commit: ${__HASH_VERSION__}]` : ''}\n` +
`Platform: ${os.type()} ${os.release()} ${os.arch()}\n` + `Platform: ${os.type()} ${os.release()} ${os.arch()}\n` +
`${err.stack}`; `${err.stack}`;
} }

View file

@ -265,7 +265,7 @@ function createTemplate(config: Config) {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
label: `Version ${app.getVersion()} commit: ${__HASH_VERSION__}`, label: `Version ${app.getVersion()}${__HASH_VERSION__ ? ` commit: ${__HASH_VERSION__}` : ''}`,
enabled: false, enabled: false,
}); });

View file

@ -136,7 +136,7 @@ window.ipcRenderer.invoke('get-app-version').then(({name, version}) => {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore // @ts-ignore
console.log(`Starting ${name} v${version} commit: ${__HASH_VERSION__}`); console.log(`Starting ${name} v${version}${__HASH_VERSION__ ? ` commit: ${__HASH_VERSION__}` : ''}`);
}); });
ReactDOM.render( ReactDOM.render(

View file

@ -14,9 +14,10 @@ const path = require('path');
const VERSION = childProcess.execSync('git rev-parse --short HEAD').toString(); const VERSION = childProcess.execSync('git rev-parse --short HEAD').toString();
const isProduction = process.env.NODE_ENV === 'production'; const isProduction = process.env.NODE_ENV === 'production';
const isRelease = process.env.CIRCLE_BRANCH && process.env.CIRCLE_BRANCH.startsWith('release-');
const codeDefinitions = { const codeDefinitions = {
__HASH_VERSION__: JSON.stringify(VERSION), __HASH_VERSION__: !isRelease && JSON.stringify(VERSION),
}; };
codeDefinitions['process.env.NODE_ENV'] = JSON.stringify(process.env.NODE_ENV); codeDefinitions['process.env.NODE_ENV'] = JSON.stringify(process.env.NODE_ENV);