@@ -72,6 +72,10 @@ EMAIL_SMTP_PORT = "1025"
72
72
EMAIL_SMTP_HOST = "email"
73
73
EMAIL_SMTP_SENDER = "ownCloud <[email protected] >"
74
74
75
+ S3_CACHE_SERVER = "https://cache.owncloud.com"
76
+ S3_CACHE_BUCKET = "cache"
77
+ S3_PUBLIC_CACHE_BUCKET = "public"
78
+
75
79
# configuration
76
80
config = {
77
81
"cs3ApiTests" : {
@@ -361,12 +365,8 @@ pipelineVolumeGo = \
361
365
362
366
# minio mc environment variables
363
367
MINIO_MC_ENV = {
364
- "CACHE_BUCKET" : {
365
- "from_secret" : "cache_s3_bucket" ,
366
- },
367
- "MC_HOST" : {
368
- "from_secret" : "cache_s3_server" ,
369
- },
368
+ "CACHE_BUCKET" : S3_CACHE_BUCKET ,
369
+ "MC_HOST" : S3_CACHE_SERVER ,
370
370
"AWS_ACCESS_KEY_ID" : {
371
371
"from_secret" : "cache_s3_access_key" ,
372
372
},
@@ -668,19 +668,13 @@ def testOcis(ctx):
668
668
"name" : "scan-result-cache" ,
669
669
"image" : PLUGINS_S3 ,
670
670
"settings" : {
671
- "endpoint" : {
672
- "from_secret" : "cache_s3_server" ,
673
- },
674
- "bucket" : "cache" ,
671
+ "endpoint" : MINIO_MC_ENV ["MC_HOST" ],
672
+ "bucket" : MINIO_MC_ENV ["CACHE_BUCKET" ],
675
673
"source" : "cache/**/*" ,
676
674
"target" : "%s/%s" % (ctx .repo .slug , ctx .build .commit + "-${DRONE_BUILD_NUMBER}" ),
677
675
"path_style" : True ,
678
- "access_key" : {
679
- "from_secret" : "cache_s3_access_key" ,
680
- },
681
- "secret_key" : {
682
- "from_secret" : "cache_s3_secret_key" ,
683
- },
676
+ "access_key" : MINIO_MC_ENV ["AWS_ACCESS_KEY_ID" ],
677
+ "secret_key" : MINIO_MC_ENV ["AWS_SECRET_ACCESS_KEY" ],
684
678
},
685
679
},
686
680
]
@@ -1085,19 +1079,13 @@ def generateCoverageFromAPITest(ctx, name):
1085
1079
"name" : "coverage-cache-1" ,
1086
1080
"image" : PLUGINS_S3 ,
1087
1081
"settings" : {
1088
- "endpoint" : {
1089
- "from_secret" : "cache_s3_server" ,
1090
- },
1091
- "bucket" : "cache" ,
1082
+ "endpoint" : MINIO_MC_ENV ["MC_HOST" ],
1083
+ "bucket" : MINIO_MC_ENV ["CACHE_BUCKET" ],
1092
1084
"source" : "cache/acceptance/coverage/coverage-%s.out" % name ,
1093
1085
"target" : "%s/%s/coverage" % (ctx .repo .slug , ctx .build .commit + "-${DRONE_BUILD_NUMBER}" ),
1094
1086
"path_style" : True ,
1095
- "access_key" : {
1096
- "from_secret" : "cache_s3_access_key" ,
1097
- },
1098
- "secret_key" : {
1099
- "from_secret" : "cache_s3_secret_key" ,
1100
- },
1087
+ "access_key" : MINIO_MC_ENV ["AWS_ACCESS_KEY_ID" ],
1088
+ "secret_key" : MINIO_MC_ENV ["AWS_SECRET_ACCESS_KEY" ],
1101
1089
},
1102
1090
},
1103
1091
]
@@ -1608,12 +1596,8 @@ def uploadTracingResult(ctx):
1608
1596
"image" : PLUGINS_S3 ,
1609
1597
"pull" : "if-not-exists" ,
1610
1598
"settings" : {
1611
- "bucket" : {
1612
- "from_secret" : "cache_public_s3_bucket" ,
1613
- },
1614
- "endpoint" : {
1615
- "from_secret" : "cache_public_s3_server" ,
1616
- },
1599
+ "bucket" : S3_PUBLIC_CACHE_BUCKET ,
1600
+ "endpoint" : S3_CACHE_SERVER ,
1617
1601
"path_style" : True ,
1618
1602
"source" : "webTestRunner/reports/e2e/playwright/tracing/**/*" ,
1619
1603
"strip_prefix" : "webTestRunner/reports/e2e/playwright/tracing" ,
@@ -2788,18 +2772,12 @@ def genericCache(name, action, mounts, cache_path):
2788
2772
"name" : "%s_%s" % (action , name ),
2789
2773
"image" : PLUGINS_S3_CACHE ,
2790
2774
"settings" : {
2791
- "endpoint" : {
2792
- "from_secret" : "cache_s3_server" ,
2793
- },
2775
+ "endpoint" : MINIO_MC_ENV ["MC_HOST" ],
2794
2776
"rebuild" : rebuild ,
2795
2777
"restore" : restore ,
2796
2778
"mount" : mounts ,
2797
- "access_key" : {
2798
- "from_secret" : "cache_s3_access_key" ,
2799
- },
2800
- "secret_key" : {
2801
- "from_secret" : "cache_s3_secret_key" ,
2802
- },
2779
+ "access_key" : MINIO_MC_ENV ["AWS_ACCESS_KEY_ID" ],
2780
+ "secret_key" : MINIO_MC_ENV ["AWS_SECRET_ACCESS_KEY" ],
2803
2781
"filename" : "%s.tar" % (name ),
2804
2782
"path" : cache_path ,
2805
2783
"fallback_path" : cache_path ,
@@ -2808,8 +2786,6 @@ def genericCache(name, action, mounts, cache_path):
2808
2786
return step
2809
2787
2810
2788
def uploadAPITestCoverageReport (ctx ):
2811
- cache_path = "%s/%s/%s" % ("cache" , ctx .repo .slug , ctx .build .commit + "-${DRONE_BUILD_NUMBER}" )
2812
-
2813
2789
sonar_env = {
2814
2790
"SONAR_TOKEN" : {
2815
2791
"from_secret" : "sonarcloud_acceptance_tests" ,
@@ -2890,15 +2866,9 @@ def genericCachePurge(flush_path):
2890
2866
"name" : "purge-cache" ,
2891
2867
"image" : PLUGINS_S3_CACHE ,
2892
2868
"settings" : {
2893
- "access_key" : {
2894
- "from_secret" : "cache_s3_access_key" ,
2895
- },
2896
- "secret_key" : {
2897
- "from_secret" : "cache_s3_secret_key" ,
2898
- },
2899
- "endpoint" : {
2900
- "from_secret" : "cache_s3_server" ,
2901
- },
2869
+ "access_key" : MINIO_MC_ENV ["AWS_ACCESS_KEY_ID" ],
2870
+ "secret_key" : MINIO_MC_ENV ["AWS_SECRET_ACCESS_KEY" ],
2871
+ "endpoint" : MINIO_MC_ENV ["MC_HOST" ],
2902
2872
"flush" : True ,
2903
2873
"flush_age" : 1 ,
2904
2874
"flush_path" : flush_path ,
@@ -2919,12 +2889,12 @@ def genericCachePurge(flush_path):
2919
2889
2920
2890
def genericBuildArtifactCache (ctx , name , action , path ):
2921
2891
if action == "rebuild" or action == "restore" :
2922
- cache_path = "%s/%s/%s" % ("cache" , ctx .repo .slug , ctx .build .commit + "-${DRONE_BUILD_NUMBER}" )
2892
+ cache_path = "%s/%s/%s" % (S3_CACHE_BUCKET , ctx .repo .slug , ctx .build .commit + "-${DRONE_BUILD_NUMBER}" )
2923
2893
name = "%s_build_artifact_cache" % (name )
2924
2894
return genericCache (name , action , [path ], cache_path )
2925
2895
2926
2896
if action == "purge" :
2927
- flush_path = "%s/%s" % ("cache" , ctx .repo .slug )
2897
+ flush_path = "%s/%s" % (S3_CACHE_BUCKET , ctx .repo .slug )
2928
2898
return genericCachePurge (flush_path )
2929
2899
return []
2930
2900
0 commit comments