[Git][ghc/ghc][wip/release-fixes] rel_eng/upload: Purge both $rel_name/ and $ver/

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Sun Mar 10 13:32:53 UTC 2024



Ben Gamari pushed to branch wip/release-fixes at Glasgow Haskell Compiler / GHC


Commits:
865d7339 by Ben Gamari at 2024-03-10T09:32:46-04:00
rel_eng/upload: Purge both $rel_name/ and $ver/

This is necessary for prereleases, where GHCup accesses the release via
`$ver/`

- - - - -


1 changed file:

- .gitlab/rel_eng/upload.sh


Changes:

=====================================
.gitlab/rel_eng/upload.sh
=====================================
@@ -136,7 +136,7 @@ function upload() {
 }
 
 function purge_all() {
-    dir="$(echo $rel_name | sed s/-release//)"
+    local dir="$(echo $rel_name | sed s/-release//)"
     # Purge CDN cache
     curl -X PURGE http://downloads.haskell.org/ghc/
     curl -X PURGE http://downloads.haskell.org/~ghc/
@@ -150,12 +150,18 @@ function purge_all() {
 }
 
 function purge_file() {
-    curl -X PURGE http://downloads.haskell.org/~ghc/$rel_name/$i
-    curl -X PURGE http://downloads.haskell.org/~ghc/$rel_name/$i/
-    curl -X PURGE http://downloads.haskell.org/~ghc/$rel_name/$i/docs/
-    curl -X PURGE http://downloads.haskell.org/ghc/$rel_name/$i
-    curl -X PURGE http://downloads.haskell.org/ghc/$rel_name/$i/
-    curl -X PURGE http://downloads.haskell.org/ghc/$rel_name/$i/docs/
+    dirs=(
+        "~ghc/$rel_name"
+        "ghc/$rel_name"
+        "~ghc/$ver"
+        "ghc/$ver"
+    )
+
+    for dir in ${dirs[@]}; do
+        curl -X PURGE http://downloads.haskell.org/$dir/$i
+        curl -X PURGE http://downloads.haskell.org/$dir/$i/
+        curl -X PURGE http://downloads.haskell.org/$dir/$i/docs/
+    done
 }
 
 function prepare_docs() {



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/865d73393d91b6f86310c9729a05a7fe871aaa6f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/865d73393d91b6f86310c9729a05a7fe871aaa6f
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240310/45c371eb/attachment-0001.html>


More information about the ghc-commits mailing list