@@ -89,15 +89,15 @@ def usage():
89
89
if os .path .exists ("local-rustup/dist" ):
90
90
shutil .rmtree ("local-rustup/dist" )
91
91
os .makedirs ("local-rustup/dist" )
92
- s3cmd = "s3cmd sync s3://{}/rustup/dist/ ./local-rustup/dist/" .format (s3_bucket )
92
+ s3cmd = "aws s3 cp --recursive s3://{}/rustup/dist/ ./local-rustup/dist/" .format (s3_bucket )
93
93
elif command == "local-to-dev-archives" \
94
94
or command == "local-to-prod-archives" :
95
- s3cmd = "s3cmd sync ./local-rustup/dist/ s3://{}/rustup/archive/{}/" .format (s3_bucket , archive_version )
95
+ s3cmd = "aws s3 cp --recursive ./local-rustup/dist/ s3://{}/rustup/archive/{}/" .format (s3_bucket , archive_version )
96
96
elif command == "local-to-prod" :
97
- s3cmd = "s3cmd sync ./ local-rustup/dist/ s3://{}/rustup/dist/" .format (s3_bucket )
97
+ s3cmd = "aws s3 cp --recursive local-rustup/dist/ s3://{}/rustup/dist/" .format (s3_bucket )
98
98
elif command == "update-dev-release" \
99
99
or command == "update-prod-release" :
100
- s3cmd = "s3cmd put ./local-rustup/release-stable.toml s3://{}/rustup/release-stable.toml" .format (s3_bucket )
100
+ s3cmd = "aws s3 cp ./local-rustup/release-stable.toml s3://{}/rustup/release-stable.toml" .format (s3_bucket )
101
101
else :
102
102
sys .exit (1 )
103
103
@@ -115,11 +115,13 @@ def run_s3cmd(command):
115
115
s3cmd = command .split (" " )
116
116
117
117
if not live_run :
118
- s3cmd += ["--dry-run " ]
118
+ s3cmd += ["--dryrun " ]
119
119
120
120
# These are old installer names for compatibility. They don't need to
121
121
# be touched ever again.
122
- s3cmd += ["--exclude=*rustup-setup*" ]
122
+ if "cloudfront" not in command :
123
+ s3cmd += ["--exclude=*rustup-setup*" ]
124
+ print ('executing: ' , s3cmd );
123
125
124
126
subprocess .check_call (s3cmd )
125
127
@@ -130,16 +132,30 @@ def run_s3cmd(command):
130
132
if command == "dev-to-local" :
131
133
if os .path .exists ("local-rustup/rustup-init.sh" ):
132
134
os .remove ("local-rustup/rustup-init.sh" )
133
- run_s3cmd ("s3cmd get s3://{}/rustup/rustup-init.sh ./local-rustup/rustup-init.sh"
135
+ run_s3cmd ("aws s3 cp s3://{}/rustup/rustup-init.sh ./local-rustup/rustup-init.sh"
134
136
.format (s3_bucket ))
135
137
if os .path .exists ("local-rustup/www" ):
136
138
shutil .rmtree ("local-rustup/www" )
137
139
os .makedirs ("local-rustup/www" )
138
- run_s3cmd ("s3cmd sync s3://{}/rustup/www/ ./local-rustup/www/"
140
+ run_s3cmd ("aws s3 cp --recursive s3://{}/rustup/www/ ./local-rustup/www/"
139
141
.format (s3_bucket ))
140
142
141
143
if command == "local-to-prod" :
142
- run_s3cmd ("s3cmd put ./local-rustup/rustup-init.sh s3://{}/rustup/rustup-init.sh"
144
+ run_s3cmd ("aws s3 cp ./local-rustup/rustup-init.sh s3://{}/rustup/rustup-init.sh"
143
145
.format (s3_bucket ))
144
- run_s3cmd ("s3cmd sync ./local-rustup/www/ s3://{}/rustup/www/"
146
+ run_s3cmd ("aws s3 cp --recursive ./local-rustup/www/ s3://{}/rustup/www/"
145
147
.format (s3_bucket ))
148
+ if live_run :
149
+ # Invalidate sh.rustup.rs
150
+ run_s3cmd ("aws cloudfront create-invalidation --distribution-id " +
151
+ "E70E9RGZ6Q27W --paths /*" .format (s3_bucket ))
152
+ # Invalidate win.rustup.rs
153
+ run_s3cmd ("aws cloudfront create-invalidation --distribution-id " +
154
+ "E2XBMULPACBLNE --paths /*" .format (s3_bucket ))
155
+ # Invalidate rustup.rs
156
+ run_s3cmd ("aws cloudfront create-invalidation --distribution-id " +
157
+ "EVJCMYBQ0EX26 --paths /*" .format (s3_bucket ))
158
+
159
+ if command == "update-dev-release" and live_run :
160
+ run_s3cmd ("aws cloudfront create-invalidation --distribution-id " +
161
+ "E30AO2GXMDY230 --paths /rustup/*" .format (s3_bucket ))
0 commit comments