@@ -13,12 +13,12 @@ export async function updateArtifacts(opts: ReleaseOpts) {
13
13
Deno . env . get ( "R2_RELEASES_SECRET_ACCESS_KEY" ) ??
14
14
( await $ `op read "op://Engineering/rivet-releases R2 Upload/password"` . text ( ) ) ;
15
15
16
+ const endpointUrl = "https://2a94c6a0ced8d35ea63cddc86c2681e7.r2.cloudflarestorage.com" ;
17
+
16
18
// Create AWS CLI command builder with credentials
17
19
const awsCommand = new CommandBuilder ( ) . env ( {
18
20
AWS_ACCESS_KEY_ID : awsAccessKeyId ,
19
21
AWS_SECRET_ACCESS_KEY : awsSecretAccessKey ,
20
- AWS_ENDPOINT_URL :
21
- "https://2a94c6a0ced8d35ea63cddc86c2681e7.r2.cloudflarestorage.com" ,
22
22
AWS_DEFAULT_REGION : "auto" ,
23
23
} ) ;
24
24
@@ -27,7 +27,7 @@ export async function updateArtifacts(opts: ReleaseOpts) {
27
27
$ . logStep ( "Listing Original Files" , commitPrefix ) ;
28
28
const commitFiles = await awsCommand
29
29
. command (
30
- `aws s3api list-objects --bucket rivet-releases --prefix ${ commitPrefix } ` ,
30
+ `aws s3api list-objects --bucket rivet-releases --prefix ${ commitPrefix } --endpoint-url ${ endpointUrl } ` ,
31
31
)
32
32
. json ( ) ;
33
33
assert (
@@ -37,34 +37,35 @@ export async function updateArtifacts(opts: ReleaseOpts) {
37
37
38
38
// Copy files to version directory
39
39
const versionTarget = `rivet/${ opts . version } /` ;
40
- await copyFiles ( awsCommand , commitPrefix , versionTarget ) ;
41
- await generateInstallScripts ( awsCommand , opts , opts . version ) ;
40
+ await copyFiles ( awsCommand , commitPrefix , versionTarget , endpointUrl ) ;
41
+ await generateInstallScripts ( awsCommand , opts , opts . version , endpointUrl ) ;
42
42
43
43
// If this is the latest version, copy to latest directory
44
44
if ( opts . latest ) {
45
- await copyFiles ( awsCommand , commitPrefix , "rivet/latest/" ) ;
46
- await generateInstallScripts ( awsCommand , opts , "latest" ) ;
45
+ await copyFiles ( awsCommand , commitPrefix , "rivet/latest/" , endpointUrl ) ;
46
+ await generateInstallScripts ( awsCommand , opts , "latest" , endpointUrl ) ;
47
47
}
48
48
}
49
49
50
50
async function copyFiles (
51
51
awsCommand : CommandBuilder ,
52
52
sourcePrefix : string ,
53
53
targetPrefix : string ,
54
+ endpointUrl : string ,
54
55
) {
55
56
$ . logStep ( "Copying Files" , targetPrefix ) ;
56
57
await $ . logGroup ( async ( ) => {
57
58
// Delete existing files in target directory using --recursive
58
59
$ . logStep ( "Deleting existing files in" , targetPrefix ) ;
59
60
await awsCommand
60
- . command ( `aws s3 rm s3://rivet-releases/${ targetPrefix } --recursive` )
61
+ . command ( `aws s3 rm s3://rivet-releases/${ targetPrefix } --recursive --endpoint-url ${ endpointUrl } ` )
61
62
. spawn ( ) ;
62
63
63
64
// Copy new files using --recursive
64
65
$ . logStep ( "Copying files from" , sourcePrefix , "to" , targetPrefix ) ;
65
66
await awsCommand
66
67
. command (
67
- `aws s3 cp s3://rivet-releases/${ sourcePrefix } s3://rivet-releases/${ targetPrefix } --recursive --copy-props none` ,
68
+ `aws s3 cp s3://rivet-releases/${ sourcePrefix } s3://rivet-releases/${ targetPrefix } --recursive --copy-props none --endpoint-url ${ endpointUrl } ` ,
68
69
)
69
70
. spawn ( ) ;
70
71
} ) ;
@@ -74,6 +75,7 @@ async function generateInstallScripts(
74
75
awsCommand : CommandBuilder ,
75
76
opts : ReleaseOpts ,
76
77
version : string ,
78
+ endpointUrl : string ,
77
79
) {
78
80
const installScriptPaths = [
79
81
resolve ( opts . root , "scripts/release/static/install.sh" ) ,
@@ -89,7 +91,7 @@ async function generateInstallScripts(
89
91
// Upload the install script to S3
90
92
$ . logStep ( "Uploading Install Script" , uploadKey ) ;
91
93
await awsCommand
92
- . command ( `aws s3 cp - s3://rivet-releases/${ uploadKey } ` )
94
+ . command ( `aws s3 cp - s3://rivet-releases/${ uploadKey } --endpoint-url ${ endpointUrl } ` )
93
95
. stdinText ( scriptContent )
94
96
. spawn ( ) ;
95
97
}
0 commit comments