@@ -28,14 +28,29 @@ aliases:
28
28
$filePathWithQuotes = '"{0}"' -f $filePath
29
29
& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86\signtool.exe" sign /a /sm /n "Redis Labs Inc." /fd sha256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /v $FilePathWithQuotes
30
30
shell : powershell.exe
31
- scan : &scan
31
+ fileScan : &fileScan
32
32
run :
33
- name : Virustotal scan
34
- command : &virusscan |
33
+ name : Virustotal file scan
34
+ command : &virusfilescan |
35
35
uploadUrl=$(curl -sq -XGET https://www.virustotal.com/api/v3/files/upload_url -H "x-apikey : $VIRUSTOTAL_API_KEY" | jq -r '.data')
36
36
uploadFile=$("/usr/bin/find" /tmp/release -name ${FILE_NAME})
37
37
echo "File to upload : ${uploadFile}"
38
38
analysedId=$(curl -sq -XPOST "${uploadUrl}" -H "x-apikey : $VIRUSTOTAL_API_KEY" --form file=@"${uploadFile}" | jq -r '.data.id')
39
+ if [ $analysedId == "null" ]; then
40
+ echo 'Status is null, something went wrong'; exit 1;
41
+ fi
42
+ echo "export ANALYZED_ID=${analysedId}" >> $BASH_ENV
43
+ echo "Virustotal Analyzed id : ${analysedId}"
44
+ sleep 10
45
+ shell : /bin/bash
46
+ urlScan : &urlScan
47
+ run :
48
+ name : Virustotal url scan
49
+ command : &virusurlscan |
50
+ echo "Url to check : ${URL}"
51
+
52
+ analysedId=$(curl -sq -XPOST https://www.virustotal.com/api/v3/urls -H "x-apikey : $VIRUSTOTAL_API_KEY" --form url=${URL} | jq -r '.data.id')
53
+
39
54
if [ $analysedId == "null" ]; then
40
55
echo 'Status is null, something went wrong'; exit 1;
41
56
fi
@@ -76,13 +91,32 @@ aliases:
76
91
echo "Results:"
77
92
echo "analazedHarmless : ${analazedHarmless}, analazedMalicious: ${analazedMalicious}, analazedSuspicious: ${analazedSuspicious}"
78
93
79
- if [ "$analazedHarmless" != "0" ] || [ "$analazedMalicious" != "0" ] || [ "$analazedSuspicious" != "0" ]; then
80
- echo 'Found dangers'; exit 1;
94
+ if [ "$analazedMalicious" != "0" ] || [ "$analazedSuspicious" != "0" ]; then
95
+ echo "export VIRUS_CHECK_FAILED=true" >> $BASH_ENV
96
+ echo 'Found dangers'; exit 0;
81
97
fi
82
98
99
+ echo "export VIRUS_CHECK_FAILED=false" >> $BASH_ENV
100
+ echo "export SKIP_VIRUSTOTAL_REPORT=true" >> $BASH_ENV
83
101
echo 'Passed';
84
102
shell : /bin/bash
85
103
no_output_timeout : 15m
104
+ virustotalReport : &virustotalReport
105
+ run :
106
+ name : Virustotal slack report
107
+ command : &virusreport |
108
+ if [ "$SKIP_VIRUSTOTAL_REPORT" == "true" ]; then
109
+ exit 0;
110
+ fi
111
+
112
+ FILE_NAME=virustotal.report.json
113
+ BUILD_NAME=$BUILD_NAME FILE_NAME=$FILE_NAME VIRUS_CHECK_FAILED=$VIRUS_CHECK_FAILED node .circleci/virustotal-report.js &&
114
+ curl -H "Content-type : application/json" --data @$FILE_NAME -H "Authorization: Bearer ${SLACK_TEST_REPORT_KEY}" -X POST https://slack.com/api/chat.postMessage
115
+
116
+ if [ "$VIRUS_CHECK_FAILED" == "true" ]; then
117
+ echo 'Found dangers'; exit 1;
118
+ fi
119
+ shell : /bin/bash
86
120
iTestsNames : &iTestsNames
87
121
- oss-st-5 # OSS Standalone v5
88
122
- oss-st-5-pass # OSS Standalone v5 with admin pass required
@@ -601,17 +635,20 @@ jobs:
601
635
yarn package:prod
602
636
yarn package:mas
603
637
rm -rf release/mac
638
+ mv release/mas-universal/RedisInsight-mac-universal-mas.pkg release/RedisInsight-mac-universal-mas.pkg
604
639
exit 0;
605
640
fi
606
641
607
642
if [ << parameters.env >> == 'stage' ]; then
608
643
UPGRADES_LINK=$UPGRADES_LINK_STAGE SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:stage && yarn package:mas
609
644
rm -rf release/mac
645
+ mv release/mas-universal/RedisInsight-mac-universal-mas.pkg release/RedisInsight-mac-universal-mas.pkg
610
646
exit 0;
611
647
fi
612
648
613
649
UPGRADES_LINK='' SEGMENT_WRITE_KEY='' yarn package:stage && yarn package:mas
614
650
rm -rf release/mac
651
+ mv release/mas-universal/RedisInsight-mac-universal-mas.pkg release/RedisInsight-mac-universal-mas.pkg
615
652
no_output_timeout : 60m
616
653
617
654
- run :
@@ -625,7 +662,7 @@ jobs:
625
662
- release/RedisInsight*.zip
626
663
- release/RedisInsight*.dmg
627
664
- release/RedisInsight*.dmg.blockmap
628
- - release/**/ *.pkg
665
+ - release/RedisInsight *.pkg
629
666
- release/*-mac.yml
630
667
- release/redisstack
631
668
windows :
@@ -674,7 +711,7 @@ jobs:
674
711
- release/RedisInsight*.exe
675
712
- release/RedisInsight*.exe.blockmap
676
713
- release/*.yml
677
- virustotal :
714
+ virustotal-file :
678
715
executor : linux-executor
679
716
parameters :
680
717
ext :
@@ -688,8 +725,35 @@ jobs:
688
725
name : export FILE_NAME environment variable
689
726
command : |
690
727
echo 'export FILE_NAME="RedisInsight*<< parameters.ext >>"' >> $BASH_ENV
691
- - << : *scan
728
+ - << : *fileScan
692
729
- << : *validate
730
+ virustotal-url :
731
+ executor : linux-executor
732
+ parameters :
733
+ fileName :
734
+ description : File name
735
+ type : string
736
+ steps :
737
+ - checkout
738
+ - run :
739
+ name : export URL environment variable
740
+ command : |
741
+ echo 'export URL="https://download.redisinsight.redis.com/latest/<< parameters.fileName >>"' >> $BASH_ENV
742
+ echo 'export BUILD_NAME="<< parameters.fileName >>"' >> $BASH_ENV
743
+ - << : *urlScan
744
+ - << : *validate
745
+ - << : *virustotalReport
746
+
747
+ virustotal-report :
748
+ executor : linux-executor
749
+ steps :
750
+ - checkout
751
+ - run :
752
+ name : Send virustotal passed report
753
+ command : |
754
+ echo 'export VIRUS_CHECK_FAILED=0' >> $BASH_ENV
755
+ echo 'export SKIP_VIRUSTOTAL_REPORT=false' >> $BASH_ENV
756
+ - << : *virustotalReport
693
757
docker :
694
758
executor : linux-executor
695
759
parameters :
@@ -1159,27 +1223,42 @@ workflows:
1159
1223
env : prod
1160
1224
requires : *prodElectronBuildRequires
1161
1225
# virus check all electron apps (prod)
1162
- - virustotal :
1226
+ - virustotal-file :
1163
1227
name : Virus check - AppImage (prod)
1164
1228
ext : .AppImage
1165
1229
requires :
1166
1230
- Build app - Linux (prod)
1167
- - virustotal :
1231
+ - virustotal-file :
1168
1232
name : Virus check - deb (prod)
1169
1233
ext : .deb
1170
1234
requires :
1171
1235
- Build app - Linux (prod)
1172
- - virustotal :
1236
+ - virustotal-file :
1237
+ name : Virus check - rpm (prod)
1238
+ ext : .rpm
1239
+ requires :
1240
+ - Build app - Linux (prod)
1241
+ - virustotal-file :
1242
+ name : Virus check - snap (prod)
1243
+ ext : .snap
1244
+ requires :
1245
+ - Build app - Linux (prod)
1246
+ - virustotal-file :
1173
1247
name : Virus check x64 - dmg (prod)
1174
1248
ext : -x64.dmg
1175
1249
requires :
1176
1250
- Build app - MacOS (prod)
1177
- - virustotal :
1251
+ - virustotal-file :
1178
1252
name : Virus check arm64 - dmg (prod)
1179
1253
ext : -arm64.dmg
1180
1254
requires :
1181
1255
- Build app - MacOS (prod)
1182
- - virustotal :
1256
+ - virustotal-file :
1257
+ name : Virus check MAS - pkg (prod)
1258
+ ext : -mas.pkg
1259
+ requires :
1260
+ - Build app - MacOS (prod)
1261
+ - virustotal-file :
1183
1262
name : Virus check - exe (prod)
1184
1263
ext : .exe
1185
1264
requires :
@@ -1190,8 +1269,11 @@ workflows:
1190
1269
requires :
1191
1270
- Virus check - AppImage (prod)
1192
1271
- Virus check - deb (prod)
1272
+ - Virus check - rpm (prod)
1273
+ - Virus check - snap (prod)
1193
1274
- Virus check x64 - dmg (prod)
1194
1275
- Virus check arm64 - dmg (prod)
1276
+ - Virus check MAS - pkg (prod)
1195
1277
- Virus check - exe (prod)
1196
1278
# Manual approve for publish release
1197
1279
- approve-publish :
@@ -1230,10 +1312,10 @@ workflows:
1230
1312
name : Build app - Linux (stage)
1231
1313
requires :
1232
1314
- Setup build (stage)
1233
- # - windows:
1234
- # name: Build app - Windows (stage)
1235
- # requires:
1236
- # - Setup build (stage)
1315
+ # - windows:
1316
+ # name: Build app - Windows (stage)
1317
+ # requires:
1318
+ # - Setup build (stage)
1237
1319
# integration tests on docker image build
1238
1320
- integration-tests-run :
1239
1321
matrix :
@@ -1254,12 +1336,49 @@ workflows:
1254
1336
requires :
1255
1337
- Build docker image
1256
1338
# e2e desktop tests on AppImage build
1257
- # - e2e-app-image:
1258
- # name: E2ETest (AppImage) - Nightly
1259
- # parallelism: 4
1260
- # report: true
1261
- # requires:
1262
- # - Build app - Linux (stage)
1339
+ - e2e-app-image :
1340
+ name : E2ETest (AppImage) - Nightly
1341
+ parallelism : 2
1342
+ report : true
1343
+ requires :
1344
+ - Build app - Linux (stage)
1345
+
1346
+ - virustotal-url :
1347
+ name : Virus check - AppImage (nightly)
1348
+ fileName : RedisInsight-v2-linux-x86_64.AppImage
1349
+ - virustotal-url :
1350
+ name : Virus check - deb (nightly)
1351
+ fileName : RedisInsight-v2-linux-amd64.deb
1352
+ - virustotal-url :
1353
+ name : Virus check - rpm (nightly)
1354
+ fileName : RedisInsight-v2-linux-x86_64.rpm
1355
+ - virustotal-url :
1356
+ name : Virus check - snap (nightly)
1357
+ fileName : RedisInsight-v2-linux-amd64.snap
1358
+ - virustotal-url :
1359
+ name : Virus check x64 - dmg (nightly)
1360
+ fileName : RedisInsight-v2-mac-x64.dmg
1361
+ - virustotal-url :
1362
+ name : Virus check arm64 - dmg (nightly)
1363
+ fileName : RedisInsight-v2-mac-arm64.dmg
1364
+ - virustotal-url :
1365
+ name : Virus check MAS - pkg (nightly)
1366
+ fileName : RedisInsight-mac-universal-mas.pkg
1367
+ - virustotal-url :
1368
+ name : Virus check - exe (nightly)
1369
+ fileName : RedisInsight-v2-win-installer.exe
1370
+ - virustotal-report :
1371
+ name : Virus check report (prod)
1372
+ requires :
1373
+ - Virus check - AppImage (nightly)
1374
+ - Virus check - deb (nightly)
1375
+ - Virus check - rpm (nightly)
1376
+ - Virus check - snap (nightly)
1377
+ - Virus check x64 - dmg (nightly)
1378
+ - Virus check arm64 - dmg (nightly)
1379
+ - Virus check MAS - pkg (nightly)
1380
+ - Virus check - exe (nightly)
1381
+
1263
1382
# # e2e desktop tests on exe build
1264
1383
# - e2e-exe:
1265
1384
# name: E2ETest (exe) - Nightly
0 commit comments