Skip to content

Commit 8dd59e9

Browse files
committed
Adjust cache_s3 usage in drone CI
1 parent 8b79280 commit 8dd59e9

1 file changed

Lines changed: 22 additions & 10 deletions

File tree

.drone.star

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dir = {
3838
config = {
3939
"rocketchat": {
4040
"channel": "builds",
41-
"from_secret": "private_rocketchat",
41+
"from_secret": "rocketchat_chat_webhook",
4242
},
4343
"branches": [
4444
"master",
@@ -682,7 +682,7 @@ def javascript(ctx, withCoverage):
682682
"image": PLUGINS_S3,
683683
"settings": {
684684
"endpoint": {
685-
"from_secret": "cache_s3_endpoint",
685+
"from_secret": "cache_s3_server",
686686
},
687687
"bucket": "cache",
688688
"source": "./coverage/lcov.info",
@@ -910,7 +910,7 @@ def phpTests(ctx, testType, withCoverage):
910910
"image": PLUGINS_S3,
911911
"settings": {
912912
"endpoint": {
913-
"from_secret": "cache_s3_endpoint",
913+
"from_secret": "cache_s3_server",
914914
},
915915
"bucket": "cache",
916916
"source": "tests/output/clover-%s.xml" % (name),
@@ -1324,13 +1324,19 @@ def sonarAnalysis(ctx, phpVersion = DEFAULT_PHP_VERSION):
13241324
"name": "sync-from-cache",
13251325
"image": MINIO_MC,
13261326
"environment": {
1327-
"MC_HOST_cache": {
1328-
"from_secret": "cache_s3_connection_url",
1327+
"S3_ACCESS_KEY": {
1328+
"from_secret": "cache_s3_access_key",
1329+
},
1330+
"S3_SECRET_KEY": {
1331+
"from_secret": "cache_s3_secret_key",
1332+
},
1333+
"S3_SERVER": {
1334+
"from_secret": "cache_s3_server",
13291335
},
13301336
},
13311337
"commands": [
13321338
"mkdir -p results",
1333-
"mc mirror cache/cache/%s/%s results/" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"),
1339+
"export MC_HOST_cache=\"https://$S3_ACCESS_KEY:$S3_SECRET_KEY@$${S3_SERVER:8}\"; mc mirror cache/cache/%s/%s results/" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"),
13341340
],
13351341
},
13361342
{
@@ -1355,12 +1361,18 @@ def sonarAnalysis(ctx, phpVersion = DEFAULT_PHP_VERSION):
13551361
"name": "purge-cache",
13561362
"image": MINIO_MC,
13571363
"environment": {
1358-
"MC_HOST_cache": {
1359-
"from_secret": "cache_s3_connection_url",
1364+
"S3_ACCESS_KEY": {
1365+
"from_secret": "cache_s3_access_key",
1366+
},
1367+
"S3_SECRET_KEY": {
1368+
"from_secret": "cache_s3_secret_key",
1369+
},
1370+
"S3_SERVER": {
1371+
"from_secret": "cache_s3_server",
13601372
},
13611373
},
13621374
"commands": [
1363-
"mc rm --recursive --force cache/cache/%s/%s" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"),
1375+
"export MC_HOST_cache=\"https://$S3_ACCESS_KEY:$S3_SECRET_KEY@$${S3_SERVER:8}\"; mc rm --recursive --force cache/cache/%s/%s" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"),
13641376
],
13651377
},
13661378
],
@@ -1691,7 +1703,7 @@ def cacheRestore():
16911703
"from_secret": "cache_s3_access_key",
16921704
},
16931705
"endpoint": {
1694-
"from_secret": "cache_s3_endpoint",
1706+
"from_secret": "cache_s3_server",
16951707
},
16961708
"restore": True,
16971709
"secret_key": {

0 commit comments

Comments
 (0)