Skip to content

Commit 2f2754e

Browse files
author
arthosofteq
authored
Merge pull request #402 from RedisInsight/build/rstack
Build/rstack
2 parents 1897bd3 + 12c9eec commit 2f2754e

File tree

10 files changed

+86
-13
lines changed

10 files changed

+86
-13
lines changed

.circleci/config.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,10 @@ jobs:
478478
condition:
479479
equal: [ true, << parameters.redisstack >> ]
480480
steps:
481+
- run:
482+
name: Repack AppImage to tar
483+
command: |
484+
ARCH=x86_64 ./.circleci/redisstack/app-image.repack.sh
481485
- run:
482486
name: Build sources
483487
command: ./.circleci/redisstack/build.sh
@@ -492,8 +496,8 @@ jobs:
492496
root: .
493497
paths:
494498
- release/RedisInsight*.deb
495-
- release/RedisInsight*.AppImage
496499
- release/RedisInsight*.rpm
500+
- release/RedisInsight*.AppImage
497501
- release/*-linux.yml
498502
- release/redisstack
499503
macosx:
@@ -540,13 +544,20 @@ jobs:
540544
UPGRADES_LINK='' SEGMENT_WRITE_KEY='' yarn package:stage
541545
rm -rf release/mac
542546
no_output_timeout: 15m
547+
548+
- run:
549+
name: Repack dmg to tar
550+
command: |
551+
ARCH=x64 ./.circleci/redisstack/dmg.repack.sh
552+
ARCH=arm64 ./.circleci/redisstack/dmg.repack.sh
543553
- persist_to_workspace:
544554
root: .
545555
paths:
546556
- release/RedisInsight*.zip
547557
- release/RedisInsight*.dmg
548558
- release/RedisInsight*.dmg.blockmap
549559
- release/*-mac.yml
560+
- release/redisstack
550561
windows:
551562
executor:
552563
name: win/default
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
ARCH=${ARCH:-x86_64}
4+
WORKING_DIRECTORY=$(pwd)
5+
SOURCE_APP=${SOURCE_APP:-"RedisInsight-V2-linux-$ARCH.AppImage"}
6+
APP_FOLDER_NAME="RedisInsight-V2-linux"
7+
TAR_NAME="RedisInsight-V2-app-linux.$ARCH.tar.gz"
8+
TMP_FOLDER="/tmp/RedisInsight-app-$ARCH"
9+
10+
rm -rf "$TMP_FOLDER"
11+
12+
mkdir -p "$WORKING_DIRECTORY/release/redisstack"
13+
mkdir -p "$TMP_FOLDER"
14+
15+
cp "./release/$SOURCE_APP" "$TMP_FOLDER"
16+
cd "$TMP_FOLDER" || exit 1
17+
18+
./"$SOURCE_APP" --appimage-extract
19+
mv squashfs-root "$APP_FOLDER_NAME"
20+
21+
tar -czvf "$TAR_NAME" "$APP_FOLDER_NAME"
22+
23+
cp "$TAR_NAME" "$WORKING_DIRECTORY/release/redisstack/"
24+
cd "$WORKING_DIRECTORY" || exit 1

.circleci/redisstack/build_modules.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
PLATFORM=${PLATFORM:-'linux'}
44
ELECTRON_VERSION=$(cat electron/version)
5-
VERSION=${ELECTRON_VERSION:-'redisstack'}
65
ARCH=${ARCH:-'x64'}
7-
FILENAME="RedisInsight-$PLATFORM.$VERSION.$ARCH.zip"
6+
#FILENAME="RedisInsight-$PLATFORM.$VERSION.$ARCH.zip"
7+
FILENAME="RedisInsight-V2-web-$PLATFORM.$ARCH.tar.gz"
88

99
# reinstall backend prod dependencies only (optimise space)
1010
rm -rf redisinsight/api/node_modules
@@ -13,19 +13,21 @@ npm_config_arch="$ARCH" \
1313
npm_config_target_arch="$ARCH" \
1414
npm_config_platform="$PLATFORM" \
1515
npm_config_target_platform="$PLATFORM" \
16-
npm_config_keytar_binary_host_mirror="$KEYTAR_MIRROR" \
17-
npm_config_node_sqlite3_binary_host_mirror="$SQLITE_MIRROR" \
1816
yarn --cwd ./redisinsight/api install --production
1917

2018
cp redisinsight/api/.yarnclean.prod redisinsight/api/.yarnclean
2119
yarn --cwd ./redisinsight/api autoclean --force
2220

2321
rm -rf redisinsight/build.zip
24-
cd redisinsight && zip -r build.zip \
22+
23+
cp LICENSE ./redisinsight
24+
25+
cd redisinsight && tar -czvf build.tar.gz \
2526
api/node_modules \
2627
api/dist \
2728
ui/dist \
29+
LICENSE \
2830
&& cd ..
2931

3032
mkdir -p release/redisstack
31-
cp redisinsight/build.zip release/redisstack/"$FILENAME"
33+
cp redisinsight/build.tar.gz release/redisstack/"$FILENAME"

.circleci/redisstack/dmg.repack.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
ARCH=${ARCH:-x64}
4+
WORKING_DIRECTORY=$(pwd)
5+
TAR_NAME="RedisInsight-V2-app-darwin.$ARCH.tar.gz"
6+
APP_FOLDER_NAME="RedisInsight-V2.app"
7+
TMP_FOLDER="/tmp/$APP_FOLDER_NAME"
8+
9+
rm -rf "$TMP_FOLDER"
10+
11+
mkdir -p "$WORKING_DIRECTORY/release/redisstack"
12+
mkdir -p "$TMP_FOLDER"
13+
14+
hdiutil attach "./release/RedisInsight-V2-mac-$ARCH.dmg"
15+
cp -a /Volumes/RedisInsight-*/RedisInsight-V2.app "/tmp"
16+
cd "/tmp" || exit 1
17+
tar -czvf "$TAR_NAME" "$APP_FOLDER_NAME"
18+
cp "$TAR_NAME" "$WORKING_DIRECTORY/release/redisstack/"
19+
cd "$WORKING_DIRECTORY" || exit 1
20+
hdiutil unmount /Volumes/RedisInsight-*/

electron-builder.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@
1515
"artifactName": "${productName}-${os}-${arch}.${ext}",
1616
"compression": "normal",
1717
"mac": {
18-
"artifactName": "${productName}-${os}-${arch}.${ext}",
1918
"target": [
2019
{
2120
"target": "dmg",
2221
"arch": ["x64", "arm64"]
23-
},
24-
{
22+
}, {
2523
"target": "zip",
2624
"arch": ["x64", "arm64"]
2725
}
@@ -93,6 +91,11 @@
9391
"from": "./redisinsight/api/defaults",
9492
"to": "defaults",
9593
"filter": ["**/*"]
94+
},
95+
{
96+
"from": "./resources/app",
97+
"to": "./app",
98+
"filter": ["**/*"]
9699
}
97100
]
98101
}

redisinsight/api/config/production.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { join } from 'path';
2+
import * as os from 'os';
23

3-
const homedir = join(require('os').homedir(), process.env.APP_FOLDER_NAME || '.redisinsight-preview');
4+
const homedir = process.env.APP_FOLDER_ABSOLUTE_PATH
5+
|| (join(os.homedir(), process.env.APP_FOLDER_NAME || '.redisinsight-preview'));
46

57
export default {
68
dir_path: {

redisinsight/api/config/staging.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { join } from 'path';
2+
import * as os from 'os';
23

3-
const homedir = join(require('os').homedir(), process.env.APP_FOLDER_NAME || '.redisinsight-v2.0-stage');
4+
const homedir = process.env.APP_FOLDER_ABSOLUTE_PATH
5+
|| (join(os.homedir(), process.env.APP_FOLDER_NAME || '.redisinsight-v2.0-stage'));
46

57
export default {
68
dir_path: {

redisinsight/api/src/modules/shared/services/instances-business/auto-discovery.service.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ export class AutoDiscoveryService implements OnModuleInit {
3434
return;
3535
}
3636

37+
// additional check for existing databases
38+
// We should not start auto discover if any database already exists
39+
if ((await this.databaseProvider.getAll()).length) {
40+
return;
41+
}
42+
3743
const settings = await this.settingsService.getSettings();
3844
// check agreements to understand if it is first launch
3945
if (!settings.agreements) {

redisinsight/main.dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const launchApiServer = async () => {
102102
const detectPortConst = await detectPort(port);
103103
process.env.API_PORT = detectPortConst?.toString();
104104
log.info('Available port:', detectPortConst);
105-
server();
105+
await server();
106106
} catch (error) {
107107
log.error('Catch server error:', error);
108108
}

resources/app/redisinsight.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
open /Applications/RedisInsight-preview

0 commit comments

Comments
 (0)