Skip to content

Commit 3dcde61

Browse files
Merge pull request #4241 from RedisInsight/feature/RI-6524-merge-dynamic-dependencies-main
Feature/ri 6524 merge dynamic dependencies main
2 parents 767e093 + b931f8e commit 3dcde61

File tree

471 files changed

+11821
-6892
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

471 files changed

+11821
-6892
lines changed

.circleci/build/release-docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -e
33

44
HELP="Args:
5-
-v - Semver (2.60.0)
5+
-v - Semver (2.62.0)
66
-d - Build image repository (Ex: -d redisinsight)
77
-r - Target repository (Ex: -r redis/redisinsight)
88
"

.circleci/config.yml

Lines changed: 7 additions & 1829 deletions
Large diffs are not rendered by default.

.circleci/config.yml.backup

Lines changed: 1868 additions & 0 deletions
Large diffs are not rendered by default.

.circleci/e2e/test.app-image.sh

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,52 @@ set -e
33

44
yarn --cwd tests/e2e install
55

6-
# mount app resources
7-
./release/*.AppImage --appimage-mount >> apppath &
6+
# Create the ri-test directory if it doesn't exist
7+
mkdir -p ri-test
8+
9+
# Extract the AppImage
10+
chmod +x ./release/*.AppImage
11+
./release/*.AppImage --appimage-extract
12+
13+
# Move contents of squashfs-root to ri-test and remove squashfs-root folder
14+
mv squashfs-root/* ri-test/
15+
rm -rf squashfs-root
16+
17+
# Export custom XDG_DATA_DIRS with ri-test
18+
export XDG_DATA_DIRS="$(pwd)/ri-test:$XDG_DATA_DIRS"
819

920
# create folder before tests run to prevent permissions issue
1021
mkdir -p tests/e2e/remote
1122
mkdir -p tests/e2e/rdi
1223

13-
# run rte
24+
# Create a custom .desktop file for RedisInsight
25+
cat > ri-test/redisinsight.desktop <<EOL
26+
[Desktop Entry]
27+
Version=1.0
28+
Name=RedisInsight
29+
Exec=$(pwd)/ri-test/redisinsight %u
30+
Icon=$(pwd)/ri-test/resources/app.asar/img/icon.png
31+
Type=Application
32+
Terminal=false
33+
MimeType=x-scheme-handler/redisinsight;
34+
EOL
35+
36+
# Copy the .desktop file to the local applications directory
37+
cp ri-test/redisinsight.desktop "$HOME/.local/share/applications"
38+
39+
# Update the desktop database with custom directory
40+
update-desktop-database "$(pwd)/ri-test/"
41+
42+
# Register the RedisInsight deeplink protocol
43+
xdg-mime default redisinsight.desktop x-scheme-handler/redisinsight
44+
45+
# Run rte
1446
docker-compose -f tests/e2e/rte.docker-compose.yml build
1547
docker-compose -f tests/e2e/rte.docker-compose.yml up --force-recreate -d -V
1648
./tests/e2e/wait-for-redis.sh localhost 12000 && \
1749

18-
# run tests
19-
COMMON_URL=$(tail -n 1 apppath)/resources/app.asar/dist/renderer/index.html \
20-
ELECTRON_PATH=$(tail -n 1 apppath)/redisinsight \
50+
# Run tests
51+
COMMON_URL=$(pwd)/ri-test/resources/app.asar/dist/renderer/index.html \
52+
ELECTRON_PATH=$(pwd)/ri-test/redisinsight \
2153
RI_SOCKETS_CORS=true \
2254
yarn --cwd tests/e2e dotenv -e .desktop.env yarn --cwd tests/e2e test:desktop:ci

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module.exports = {
22
root: true,
33
env: {
44
node: true,
5+
browser: true,
56
},
67
extends: ['airbnb-typescript'],
78
plugins: ['@typescript-eslint'],
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy Pages
2+
description: 'Download the artifact and deploy to GitHub Pages'
3+
4+
inputs:
5+
group:
6+
description: Group matching the artifacts
7+
required: false
8+
default: '*'
9+
path:
10+
description: Path for link to the report
11+
required: false
12+
default: ''
13+
14+
AWS_BUCKET_NAME_TEST:
15+
required: true
16+
AWS_DEFAULT_REGION:
17+
required: true
18+
AWS_DISTRIBUTION_ID:
19+
required: true
20+
AWS_ACCESS_KEY_ID:
21+
required: true
22+
AWS_SECRET_ACCESS_KEY:
23+
required: true
24+
25+
runs:
26+
using: 'composite'
27+
steps:
28+
29+
- name: Get current date
30+
id: date
31+
uses: ./.github/actions/get-current-date
32+
33+
- name: Download artifacts
34+
uses: actions/download-artifact@v4
35+
with:
36+
pattern: ${{ format('{0}*', inputs.group) }}
37+
path: public/${{ github.run_id }}
38+
39+
- name: Deploy 🚀
40+
shell: bash
41+
env:
42+
AWS_BUCKET_NAME_TEST: ${{ inputs.AWS_BUCKET_NAME_TEST }}
43+
AWS_DEFAULT_REGION: ${{ inputs.AWS_DEFAULT_REGION }}
44+
AWS_DISTRIBUTION_ID: ${{ inputs.AWS_DISTRIBUTION_ID }}
45+
AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }}
46+
AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
47+
run: |
48+
49+
SUB_PATH=test-reports/${{ steps.date.outputs.date }}
50+
51+
aws s3 cp public/ s3://${AWS_BUCKET_NAME_TEST}/public/${SUB_PATH} --recursive
52+
53+
- name: Add link to report in the workflow summary
54+
shell: bash
55+
run: |
56+
link="${{ inputs.path }}/index.html"
57+
58+
echo "- [${link}](${link})" >> $GITHUB_STEP_SUMMARY
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Get current date
2+
3+
outputs:
4+
date:
5+
description: Current date
6+
value: ${{ steps.date.outputs.date }}
7+
8+
runs:
9+
using: 'composite'
10+
steps:
11+
- name: Get current date
12+
id: date
13+
shell: bash
14+
run: |
15+
DATE=$(date +'%Y-%m-%d')
16+
echo "date=$DATE" >> $GITHUB_OUTPUT
17+

.github/actions/install-all-build-libs/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ runs:
3333
- name: Setup Node
3434
uses: actions/[email protected]
3535
with:
36-
node-version: '20.15'
36+
node-version: '20.18.0'
3737
# disable cache for windows
3838
# https://github.com/actions/setup-node/issues/975
3939
cache: ${{ runner.os != 'Windows' && 'yarn' || '' }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Remove all artifacts
2+
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Merge artifacts by pattern
7+
id: merge-artifacts
8+
uses: actions/upload-artifact/merge@v4
9+
with:
10+
name: remove-artifacts
11+
pattern: '*'
12+
delete-merged: true
13+
14+
- name: Delete merged artifact
15+
uses: actions/github-script@v7
16+
with:
17+
script: |
18+
github.rest.actions.deleteArtifact({
19+
owner: context.repo.owner,
20+
repo: context.repo.repo,
21+
artifact_id: ${{ steps.merge-artifacts.outputs.artifact-id }}
22+
});
23+

.github/build/build.Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM node:20.14-alpine
2+
3+
# runtime args and environment variables
4+
ARG DIST=Redis-Insight.tar.gz
5+
ARG NODE_ENV=production
6+
ARG RI_SEGMENT_WRITE_KEY
7+
ENV RI_SEGMENT_WRITE_KEY=${RI_SEGMENT_WRITE_KEY}
8+
ENV NODE_ENV=${NODE_ENV}
9+
ENV RI_SERVE_STATICS=true
10+
ENV RI_BUILD_TYPE='DOCKER_ON_PREMISE'
11+
ENV RI_APP_FOLDER_ABSOLUTE_PATH='/data'
12+
13+
# this resolves CVE-2023-5363
14+
# TODO: remove this line once we update to base image that doesn't have this vulnerability
15+
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3
16+
17+
# set workdir
18+
WORKDIR /usr/src/app
19+
20+
# copy artifacts built in previous stage to this one
21+
ADD $DIST /usr/src/app/redisinsight
22+
RUN ls -la /usr/src/app/redisinsight
23+
24+
# folder to store local database, plugins, logs and all other files
25+
RUN mkdir -p /data && chown -R node:node /data
26+
27+
# copy the docker entry point script and make it executable
28+
COPY --chown=node:node ./docker-entry.sh ./
29+
RUN chmod +x docker-entry.sh
30+
31+
# since RI is hard-code to port 5000, expose it from the container
32+
EXPOSE 5000
33+
34+
# don't run the node process as root
35+
USER node
36+
37+
# serve the application 🚀
38+
ENTRYPOINT ["./docker-entry.sh", "node", "redisinsight/api/dist/src/main"]

0 commit comments

Comments
 (0)