Skip to content

Commit fd40f79

Browse files
author
arthosofteq
authored
Merge pull request #93 from RedisInsight/feature/RI-1841-auto-update-stage-build
#RI-1841 - add support for auto updates to stage builds
2 parents 0492eee + 6d6f329 commit fd40f79

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ jobs:
432432
exit 0;
433433
fi
434434
435-
SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
435+
UPGRADES_LINK=$UPGRADES_LINK_STAGE SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
436436
- persist_to_workspace:
437437
root: .
438438
paths:
@@ -474,7 +474,7 @@ jobs:
474474
exit 0;
475475
fi
476476
477-
SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
477+
UPGRADES_LINK=$UPGRADES_LINK_STAGE SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
478478
rm -rf release/mac
479479
no_output_timeout: 15m
480480
- persist_to_workspace:
@@ -514,7 +514,7 @@ jobs:
514514
exit 0;
515515
fi
516516
517-
SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
517+
UPGRADES_LINK=$UPGRADES_LINK_STAGE SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
518518
rm -rf release/win-unpacked
519519
shell: bash.exe
520520
no_output_timeout: 20m

redisinsight/main.dev.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ if (process.env.NODE_ENV !== 'production') {
4444
log.info('App starting.....');
4545

4646
export default class AppUpdater {
47-
constructor() {
47+
constructor(url: string = '') {
4848
log.info('AppUpdater initialization');
4949
log.transports.file.level = 'info';
5050

5151
try {
5252
autoUpdater.setFeedURL({
5353
provider: 'generic',
54-
url: process.env.MANUAL_UPGRADES_LINK || process.env.UPGRADES_LINK,
54+
url,
5555
});
5656
} catch (error) {
5757
log.error(error);
@@ -119,8 +119,10 @@ const bootstrap = async () => {
119119
trayInstance = tray.buildTray();
120120
}
121121

122-
if (process.env.NODE_ENV === 'production') {
123-
new AppUpdater();
122+
const upgradeUrl = process.env.MANUAL_UPGRADES_LINK || process.env.UPGRADES_LINK;
123+
124+
if (upgradeUrl) {
125+
new AppUpdater(upgradeUrl);
124126
}
125127

126128
app.setName('RedisInsight');

0 commit comments

Comments
 (0)