mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-02-18 01:05:48 +01:00
V2 upload by default, --server-url option when building
This commit is contained in:
parent
52580761e7
commit
d0138fae7a
@ -1,3 +1,7 @@
|
|||||||
|
## 0.6.1
|
||||||
|
|
||||||
|
* Switch to V2 upload by default
|
||||||
|
|
||||||
## 0.6.0
|
## 0.6.0
|
||||||
|
|
||||||
* Upload bundle V2 stuff
|
* Upload bundle V2 stuff
|
||||||
|
|||||||
@ -40,7 +40,8 @@ data BuildFlags = BuildFlags
|
|||||||
, bfEnableExecDyn :: !Bool
|
, bfEnableExecDyn :: !Bool
|
||||||
, bfVerbose :: !Bool
|
, bfVerbose :: !Bool
|
||||||
, bfSkipCheck :: !Bool
|
, bfSkipCheck :: !Bool
|
||||||
, bfUploadV2 :: !Bool
|
, bfUploadV1 :: !Bool
|
||||||
|
, bfServer :: !StackageServer
|
||||||
} deriving (Show)
|
} deriving (Show)
|
||||||
|
|
||||||
data BuildType = Nightly | LTS BumpType
|
data BuildType = Nightly | LTS BumpType
|
||||||
@ -253,7 +254,11 @@ completeBuild buildType buildFlags = withManager tlsManagerSettings $ \man -> do
|
|||||||
}
|
}
|
||||||
|
|
||||||
when (bfDoUpload buildFlags) $
|
when (bfDoUpload buildFlags) $
|
||||||
finallyUpload (bfUploadV2 buildFlags) settings man
|
finallyUpload
|
||||||
|
(not $ bfUploadV1 buildFlags)
|
||||||
|
(bfServer buildFlags)
|
||||||
|
settings
|
||||||
|
man
|
||||||
|
|
||||||
justUploadNightly
|
justUploadNightly
|
||||||
:: Text -- ^ nightly date
|
:: Text -- ^ nightly date
|
||||||
@ -261,7 +266,7 @@ justUploadNightly
|
|||||||
justUploadNightly day = do
|
justUploadNightly day = do
|
||||||
plan <- decodeFileEither (fpToString $ nightlyPlanFile day)
|
plan <- decodeFileEither (fpToString $ nightlyPlanFile day)
|
||||||
>>= either throwM return
|
>>= either throwM return
|
||||||
withManager tlsManagerSettings $ finallyUpload False $ nightlySettings day plan
|
withManager tlsManagerSettings $ finallyUpload False def $ nightlySettings day plan
|
||||||
|
|
||||||
getStackageAuthToken :: IO Text
|
getStackageAuthToken :: IO Text
|
||||||
getStackageAuthToken = do
|
getStackageAuthToken = do
|
||||||
@ -273,8 +278,9 @@ getStackageAuthToken = do
|
|||||||
-- | The final part of the complete build process: uploading a bundle,
|
-- | The final part of the complete build process: uploading a bundle,
|
||||||
-- docs and a distro to hackage.
|
-- docs and a distro to hackage.
|
||||||
finallyUpload :: Bool -- ^ use v2 upload
|
finallyUpload :: Bool -- ^ use v2 upload
|
||||||
|
-> StackageServer
|
||||||
-> Settings -> Manager -> IO ()
|
-> Settings -> Manager -> IO ()
|
||||||
finallyUpload useV2 settings@Settings{..} man = do
|
finallyUpload useV2 server settings@Settings{..} man = do
|
||||||
putStrLn "Uploading bundle to Stackage Server"
|
putStrLn "Uploading bundle to Stackage Server"
|
||||||
|
|
||||||
token <- getStackageAuthToken
|
token <- getStackageAuthToken
|
||||||
@ -282,7 +288,7 @@ finallyUpload useV2 settings@Settings{..} man = do
|
|||||||
if useV2
|
if useV2
|
||||||
then do
|
then do
|
||||||
res <- flip uploadBundleV2 man UploadBundleV2
|
res <- flip uploadBundleV2 man UploadBundleV2
|
||||||
{ ub2Server = def
|
{ ub2Server = server
|
||||||
, ub2AuthToken = token
|
, ub2AuthToken = token
|
||||||
, ub2Bundle = bundleDest
|
, ub2Bundle = bundleDest
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,7 @@ module Stackage.Upload
|
|||||||
, uploadBundleV2
|
, uploadBundleV2
|
||||||
, UploadBundleV2 (..)
|
, UploadBundleV2 (..)
|
||||||
, def
|
, def
|
||||||
|
, StackageServer
|
||||||
, unStackageServer
|
, unStackageServer
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
|||||||
@ -110,8 +110,13 @@ main =
|
|||||||
(long "skip-check" <>
|
(long "skip-check" <>
|
||||||
help "Skip the check phase, and pass --allow-newer to cabal configure") <*>
|
help "Skip the check phase, and pass --allow-newer to cabal configure") <*>
|
||||||
switch
|
switch
|
||||||
(long "upload-v2" <>
|
(long "upload-v1" <>
|
||||||
help "Use the V2 upload code")
|
help "Use the V1 upload code") <*>
|
||||||
|
(fmap fromString (strOption
|
||||||
|
(long "server-url" <>
|
||||||
|
metavar "SERVER-URL" <>
|
||||||
|
showDefault <> value (T.unpack $ unStackageServer def) <>
|
||||||
|
help "Server to upload bundle to")))
|
||||||
|
|
||||||
nightlyUploadFlags = fromString <$> strArgument
|
nightlyUploadFlags = fromString <$> strArgument
|
||||||
(metavar "DATE" <>
|
(metavar "DATE" <>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user