@@ -9,6 +9,7 @@ import type {
9
9
} from '@mongodb-js/dl-center/dist/download-center-config' ;
10
10
import {
11
11
ARTIFACTS_BUCKET ,
12
+ ARTIFACTS_BUCKET_NEW ,
12
13
JSON_FEED_ARTIFACT_KEY ,
13
14
ARTIFACTS_URL_PUBLIC_BASE ,
14
15
CONFIGURATION_KEY ,
@@ -55,6 +56,9 @@ export async function createAndPublishDownloadCenterConfig(
55
56
packageInformation : PackageInformationProvider ,
56
57
awsAccessKeyId : string ,
57
58
awsSecretAccessKey : string ,
59
+ awsAccessKeyIdNew : string ,
60
+ awsSecretAccessKeyNew : string ,
61
+ awsSessionTokenNew : string ,
58
62
injectedJsonFeedFile : string ,
59
63
isDryRun : boolean ,
60
64
ctaConfig : CTAConfig ,
@@ -100,6 +104,13 @@ export async function createAndPublishDownloadCenterConfig(
100
104
secretAccessKey : awsSecretAccessKey ,
101
105
} ) ;
102
106
107
+ const dlcenterArtifactsNew = new DownloadCenter ( {
108
+ bucket : ARTIFACTS_BUCKET_NEW ,
109
+ accessKeyId : awsAccessKeyIdNew ,
110
+ secretAccessKey : awsSecretAccessKeyNew ,
111
+ sessionToken : awsSessionTokenNew ,
112
+ } ) ;
113
+
103
114
const existingJsonFeed = await getCurrentJsonFeed ( dlcenterArtifacts ) ;
104
115
const injectedJsonFeed : JsonFeed | undefined = injectedJsonFeedFile
105
116
? JSON . parse ( await fs . readFile ( injectedJsonFeedFile , 'utf8' ) )
@@ -135,12 +146,20 @@ export async function createAndPublishDownloadCenterConfig(
135
146
JSON . stringify ( newJsonFeed , null , 2 )
136
147
) ,
137
148
] ) ;
149
+
150
+ await dlcenterArtifactsNew . uploadAsset (
151
+ JSON_FEED_ARTIFACT_KEY ,
152
+ JSON . stringify ( newJsonFeed , null , 2 )
153
+ ) ;
138
154
}
139
155
140
156
export async function updateJsonFeedCTA (
141
157
config : CTAConfig ,
142
158
awsAccessKeyId : string ,
143
159
awsSecretAccessKey : string ,
160
+ awsAccessKeyIdNew : string ,
161
+ awsSecretAccessKeyNew : string ,
162
+ awsSessionTokenNew : string ,
144
163
isDryRun : boolean ,
145
164
DownloadCenter : typeof DownloadCenterCls = DownloadCenterCls
146
165
) {
@@ -150,6 +169,13 @@ export async function updateJsonFeedCTA(
150
169
secretAccessKey : awsSecretAccessKey ,
151
170
} ) ;
152
171
172
+ const dlcenterArtifactsNew = new DownloadCenter ( {
173
+ bucket : ARTIFACTS_BUCKET_NEW ,
174
+ accessKeyId : awsAccessKeyIdNew ,
175
+ secretAccessKey : awsSecretAccessKeyNew ,
176
+ sessionToken : awsSessionTokenNew ,
177
+ } ) ;
178
+
153
179
const jsonFeed = await getCurrentJsonFeed ( dlcenterArtifacts ) ;
154
180
if ( ! jsonFeed ) {
155
181
throw new Error ( 'No existing JSON feed found' ) ;
@@ -165,6 +191,10 @@ export async function updateJsonFeedCTA(
165
191
}
166
192
167
193
await dlcenterArtifacts . uploadAsset ( JSON_FEED_ARTIFACT_KEY , patchedJsonFeed ) ;
194
+ await dlcenterArtifactsNew . uploadAsset (
195
+ JSON_FEED_ARTIFACT_KEY ,
196
+ patchedJsonFeed
197
+ ) ;
168
198
}
169
199
170
200
function populateJsonFeedCTAs ( jsonFeed : JsonFeed , ctas : CTAConfig ) {
0 commit comments