mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-12 04:08:29 +01:00
Upgrade to lts-5
This commit is contained in:
parent
0e46ca9964
commit
26af5d29ed
@ -28,6 +28,7 @@ mkFeed mBranch snaps = do
|
||||
, feedEntryUpdated = UTCTime (snapshotCreated snap) 0
|
||||
, feedEntryTitle = prettyName (snapshotName snap) (snapshotGhc snap)
|
||||
, feedEntryContent = content
|
||||
, feedEntryEnclosure = Nothing
|
||||
}
|
||||
updated <-
|
||||
case entries of
|
||||
@ -42,6 +43,7 @@ mkFeed mBranch snaps = do
|
||||
, feedLanguage = "en"
|
||||
, feedUpdated = updated
|
||||
, feedEntries = entries
|
||||
, feedLogo = Nothing
|
||||
}
|
||||
where
|
||||
branchTitle NightlyBranch = "Nightly"
|
||||
|
||||
@ -21,12 +21,15 @@ import Control.Monad.State.Strict (StateT, get, put)
|
||||
import Network.HTTP.Types (status200)
|
||||
import Data.Streaming.Network (bindPortTCP)
|
||||
import Network.AWS (Credentials (Discover),
|
||||
Region (NorthVirginia), getEnv,
|
||||
send, sourceFileIO, envManager)
|
||||
import Network.AWS.Data (toBody)
|
||||
import Network.AWS.S3 (ObjectCannedACL (PublicRead),
|
||||
poACL,
|
||||
putObject)
|
||||
Region (NorthVirginia), newEnv,
|
||||
send, chunkedFile, defaultChunkSize,
|
||||
envManager, runAWS)
|
||||
import Control.Monad.Trans.AWS (trying, _Error)
|
||||
import Network.AWS.Data.Body (toBody)
|
||||
import Network.AWS.S3 (ObjectCannedACL (OPublicRead),
|
||||
poACL, putObject,
|
||||
BucketName(BucketName),
|
||||
ObjectKey(ObjectKey))
|
||||
import Control.Lens (set, view)
|
||||
import qualified Data.Conduit.Binary as CB
|
||||
import Data.Conduit.Zlib (WindowBits (WindowBits),
|
||||
@ -154,37 +157,37 @@ stackageServerCron = do
|
||||
void $ catchIO (bindPortTCP 17834 "127.0.0.1") $ \_ ->
|
||||
error $ "cabal loader process already running, exiting"
|
||||
|
||||
env <- getEnv NorthVirginia Discover
|
||||
let upload :: FilePath -> Text -> IO ()
|
||||
env <- newEnv NorthVirginia Discover
|
||||
let upload :: FilePath -> ObjectKey -> IO ()
|
||||
upload fp key = do
|
||||
let fpgz = fp <.> "gz"
|
||||
runResourceT $ sourceFile fp
|
||||
$$ compress 9 (WindowBits 31)
|
||||
=$ CB.sinkFile fpgz
|
||||
body <- sourceFileIO fpgz
|
||||
body <- chunkedFile defaultChunkSize fpgz
|
||||
let po =
|
||||
set poACL (Just PublicRead)
|
||||
$ putObject body "haddock.stackage.org" key
|
||||
putStrLn $ "Uploading: " ++ key
|
||||
eres <- runResourceT $ send env po
|
||||
set poACL (Just OPublicRead)
|
||||
$ putObject "haddock.stackage.org" key body
|
||||
putStrLn $ "Uploading: " ++ tshow key
|
||||
eres <- runResourceT $ runAWS env $ trying _Error $ send po
|
||||
case eres of
|
||||
Left e -> error $ show (fp, key, e)
|
||||
Right _ -> putStrLn "Success"
|
||||
|
||||
let dbfp = fromText keyName
|
||||
createStackageDatabase dbfp
|
||||
upload (encodeString dbfp) keyName
|
||||
upload (encodeString dbfp) (ObjectKey keyName)
|
||||
|
||||
db <- openStackageDatabase dbfp
|
||||
|
||||
do
|
||||
snapshots <- runReaderT snapshotsJSON db
|
||||
let key = "snapshots.json" :: Text
|
||||
let key = ObjectKey "snapshots.json"
|
||||
po =
|
||||
set poACL (Just PublicRead)
|
||||
$ putObject (toBody snapshots) "haddock.stackage.org" key
|
||||
putStrLn $ "Uploading: " ++ key
|
||||
eres <- runResourceT $ send env po
|
||||
set poACL (Just OPublicRead)
|
||||
$ putObject (BucketName "haddock.stackage.org") key (toBody snapshots)
|
||||
putStrLn $ "Uploading: " ++ tshow key
|
||||
eres <- runResourceT $ runAWS env $ trying _Error $ send po
|
||||
case eres of
|
||||
Left e -> error $ show (key, e)
|
||||
Right _ -> putStrLn "Success"
|
||||
@ -199,7 +202,7 @@ stackageServerCron = do
|
||||
mfp' <- createHoogleDB db manager name
|
||||
forM_ mfp' $ \fp -> do
|
||||
let key = hoogleKey name
|
||||
upload fp key
|
||||
upload fp (ObjectKey key)
|
||||
let dest = unpack key
|
||||
createTree $ parent (fromString dest)
|
||||
rename (fromString fp) (fromString dest)
|
||||
|
||||
@ -1,7 +1,4 @@
|
||||
resolver: lts-3.9
|
||||
extra-deps:
|
||||
- these-0.6.1.0
|
||||
- barrier-0.1.0
|
||||
resolver: lts-5.1
|
||||
image:
|
||||
container:
|
||||
name: snoyberg/stackage-server
|
||||
|
||||
@ -90,9 +90,9 @@ library
|
||||
|
||||
build-depends:
|
||||
base >= 4.8 && < 4.9
|
||||
, aeson >= 0.8 && < 0.9
|
||||
, aeson-extra >= 0.2 && < 0.3
|
||||
, aws >= 0.12 && < 0.13
|
||||
, aeson >= 0.9 && < 0.10
|
||||
, aeson-extra >= 0.3 && < 0.4
|
||||
, aws >= 0.13 && < 0.14
|
||||
, barrier >= 0.1 && < 0.2
|
||||
, base16-bytestring >= 0.1 && < 0.2
|
||||
, blaze-markup >= 0.7 && < 0.8
|
||||
@ -106,7 +106,7 @@ library
|
||||
, cryptohash-conduit >= 0.1.1 && < 0.2
|
||||
, data-default >= 0.5 && < 0.6
|
||||
, directory >= 1.2 && < 1.3
|
||||
, email-validate >= 2.1 && < 2.2
|
||||
, email-validate >= 2.2 && < 2.3
|
||||
, esqueleto >= 2.4 && < 2.5
|
||||
, exceptions >= 0.8 && < 0.9
|
||||
, fast-logger >= 2.4 && < 2.5
|
||||
@ -125,15 +125,15 @@ library
|
||||
, shakespeare >= 2.0 && < 2.1
|
||||
, system-fileio >= 0.3 && < 0.4
|
||||
, system-filepath >= 0.4 && < 0.5
|
||||
, tar >= 0.4 && < 0.5
|
||||
, tar >= 0.5 && < 0.6
|
||||
, template-haskell >= 2.10 && < 2.11
|
||||
, temporary-rc >= 1.2 && < 1.3
|
||||
, text >= 1.2 && < 1.3
|
||||
, these >= 0.6 && < 0.7
|
||||
, wai >= 3.0 && < 3.1
|
||||
, wai >= 3.2 && < 3.3
|
||||
, wai-extra >= 3.0 && < 3.1
|
||||
, wai-logger >= 2.2 && < 2.3
|
||||
, warp >= 3.1 && < 3.2
|
||||
, warp >= 3.2 && < 3.3
|
||||
, xml-conduit >= 1.3 && < 1.4
|
||||
, yaml >= 0.8 && < 0.9
|
||||
, yesod >= 1.4 && < 1.5
|
||||
@ -142,12 +142,12 @@ library
|
||||
, yesod-form >= 1.4 && < 1.5
|
||||
, yesod-newsfeed
|
||||
, yesod-static >= 1.5 && < 1.6
|
||||
, zlib >= 0.5 && < 0.6
|
||||
, zlib >= 0.6 && < 0.7
|
||||
, unordered-containers >= 0.2 && < 0.3
|
||||
, hashable >= 1.2 && < 1.3
|
||||
, Cabal >= 1.22 && < 1.23
|
||||
, lifted-base >= 0.2 && < 0.3
|
||||
, mono-traversable >= 0.9 && < 0.10
|
||||
, mono-traversable >= 0.10 && < 0.11
|
||||
, time >= 1.5 && < 1.6
|
||||
, process >= 1.2 && < 1.3
|
||||
, old-locale >= 1.0 && < 1.1
|
||||
@ -158,14 +158,14 @@ library
|
||||
, formatting >= 6.2 && < 6.3
|
||||
, blaze-html >= 0.8 && < 0.9
|
||||
, haddock-library >= 1.2.0 && < 1.3
|
||||
, async >= 2.0 && < 2.1
|
||||
, async >= 2.1 && < 2.2
|
||||
, yesod-gitrepo >= 0.2 && < 0.3
|
||||
, hoogle >= 4.2 && < 4.3
|
||||
, spoon >= 0.3 && < 0.4
|
||||
, deepseq >= 1.4 && < 1.5
|
||||
, deepseq-generics >= 0.1 && < 0.2
|
||||
, auto-update >= 0.1 && < 0.2
|
||||
, stackage-types >= 1.1 && < 1.2
|
||||
, stackage-types >= 1.2 && < 1.3
|
||||
, stackage-build-plan >= 0.1.1 && < 0.2
|
||||
, yesod-sitemap >= 1.4 && < 1.5
|
||||
, streaming-commons >= 0.1 && < 0.2
|
||||
@ -175,11 +175,11 @@ library
|
||||
, stackage-metadata >= 0.3 && < 0.4
|
||||
, filepath >= 1.4 && < 1.5
|
||||
, http-client >= 0.4 && < 0.5
|
||||
, http-types >= 0.8 && < 0.9
|
||||
, amazonka >= 0.3 && < 0.4
|
||||
, amazonka-core >= 0.3 && < 0.4
|
||||
, amazonka-s3 >= 0.3 && < 0.4
|
||||
, lens >= 4.12 && < 4.13
|
||||
, http-types >= 0.9 && < 0.10
|
||||
, amazonka >= 1.3 && < 1.4
|
||||
, amazonka-core >= 1.3 && < 1.4
|
||||
, amazonka-s3 >= 1.3 && < 1.4
|
||||
, lens >= 4.13 && < 4.14
|
||||
|
||||
executable stackage-server
|
||||
if flag(library-only)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user