Skip to content

Commit e5dbde5

Browse files
authored
Merge pull request #47 from juhp/master
add CURATOR_AWS_OPTIONS
2 parents 54cc5a9 + b4975dc commit e5dbde5

File tree

3 files changed

+23
-20
lines changed

3 files changed

+23
-20
lines changed

curator.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 1.12
22

3-
-- This file has been generated from package.yaml by hpack version 0.35.2.
3+
-- This file has been generated from package.yaml by hpack version 0.36.1.
44
--
55
-- see: https://github.com/sol/hpack
66

@@ -57,7 +57,7 @@ executable casa-curator
5757
TypeOperators
5858
ghc-options: -optP-Wno-nonportable-include-path -threaded
5959
build-depends:
60-
aeson
60+
aeson <2.2
6161
, base >=4.10 && <5
6262
, bytestring
6363
, casa-client

package.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ executables:
5656
- text
5757
- optparse-simple
5858
- containers
59-
- aeson
59+
# aeson 2.2 needs attoparsec-aeson
60+
- aeson < 2.2
6061
- http-conduit
6162
- syb
6263
- persistent-sqlite

src/Curator/UploadDocs.hs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import qualified RIO.ByteString.Lazy as BL
1717
import RIO.Process
1818
import RIO.FilePath ((</>))
1919

20+
import System.Environment.Blank (getEnvDefault)
21+
2022
import qualified Codec.Archive.Tar as Tar
2123
import qualified Codec.Archive.Tar.Entry as Tar
2224

@@ -42,26 +44,26 @@ uploadDocs input' name bucket = do
4244
D.createDirectoryIfMissing True $ input </> "hoogle"
4345
BL.writeFile (input </> "hoogle" </> "orig.tar") hooglesLBS
4446

47+
-- maybe default to --quiet or "--only-show-errors"?
48+
curator_AWS_OPTS <- liftIO $ fmap words $
49+
getEnvDefault "CURATOR_AWS_OPTIONS" ""
4550
logInfo "Shelling out to AWS CLI to upload docs"
4651
proc
4752
"time" -- added for https://github.com/commercialhaskell/stackage-infrastructure/issues/4
48-
(
49-
"aws"
50-
: -- added for https://github.com/commercialhaskell/stackage-infrastructure/issues/4
51-
[
52-
"s3"
53-
, "cp"
54-
-- -- commented out to debug https://github.com/commercialhaskell/stackage-infrastructure/issues/4
55-
--, "--only-show-errors"
56-
, "--recursive"
57-
, "--acl"
58-
, "public-read"
59-
, "--cache-control"
60-
, "maxage=31536000"
61-
, input
62-
, T.unpack $ "s3://" <> bucket <> "/" <> name <> "/"
63-
]
64-
) -- added for https://github.com/commercialhaskell/stackage-infrastructure/issues/4
53+
( [ "aws"
54+
, "s3"
55+
, "cp"]
56+
++
57+
curator_AWS_OPTS
58+
++
59+
[ "--recursive"
60+
, "--acl"
61+
, "public-read"
62+
, "--cache-control"
63+
, "maxage=31536000"
64+
, input
65+
, T.unpack $ "s3://" <> bucket <> "/" <> name <> "/"
66+
] )
6567
runProcess_
6668

6769
-- | Create a TAR entry for each Hoogle txt file. Unfortunately doesn't stream.

0 commit comments

Comments
 (0)