[Git][ghc/ghc][master] rel_eng/upload: Purge both $rel_name/ and $ver/

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Mon Mar 11 05:21:42 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
0590764c by Ben Gamari at 2024-03-11T01:20:39-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/0590764c73841115fc567757e370d5c9dc7e6478

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0590764c73841115fc567757e370d5c9dc7e6478
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/20240311/4e2a519e/attachment-0001.html>


More information about the ghc-commits mailing list