Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 6b69363

Browse files
committed
infra: single publish
1 parent 79c4a1c commit 6b69363

File tree

7 files changed

+588
-338
lines changed

7 files changed

+588
-338
lines changed

infra/default.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ rec
77
cp ${pkgs.wai-lambda.wai-lambda-js-wrapper} main.js
88
# Can't be called 'main' otherwise lambda tries to load it
99
cp "${handler}/bin/handler" main_hs
10+
cp ${deckdeckgo-starter-dist}/dist.tar dist.tar
1011
mkdir $out
11-
${pkgs.zip}/bin/zip -r $out/function.zip main.js main_hs
12+
${pkgs.zip}/bin/zip -r $out/function.zip main.js main_hs dist.tar
1213
'';
1314

1415
# TODO: move all other builders to this

infra/handler/app/Handler.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ main = do
3535

3636
putStrLn "Connection acquired, starting lambda..."
3737

38-
Lambda.run $ cors $ DeckGo.Handler.application settings env conn
38+
Lambda.runSettings settings' $ cors $ DeckGo.Handler.application settings env conn
39+
where
40+
settings' = Lambda.defaultSettings
41+
{ Lambda.timeoutValue = 20 * 1000 * 1000 }
3942

4043
-- TODO: factor out
4144
getFirebaseSettings :: AWS.Env -> IO Firebase.FirebaseLoginSettings

infra/handler/app/Presenter.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import Control.Monad
55
import Data.Aeson ((.:))
66
import DeckGo.Handler
7-
import DeckGo.Presenter
7+
-- import DeckGo.Presenter
88
import System.Environment (getEnv)
99
import UnliftIO
1010
import qualified Data.Aeson as Aeson

infra/handler/app/Test.hs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Control.Monad
1010
import Data.List (sortOn)
1111
import Data.Monoid (First)
1212
import DeckGo.Handler
13-
import DeckGo.Presenter
13+
-- import DeckGo.Presenter
1414
import Network.HTTP.Client (newManager, defaultManagerSettings)
1515
import Network.HTTP.Types as HTTP
1616
import Servant.API
@@ -137,6 +137,8 @@ withPristineDB act = do
137137
void $ HS.run (HS.sql "DROP TABLE IF EXISTS account CASCADE") conn
138138
putStrLn "DROP TABLE IF EXISTS slide"
139139
void $ HS.run (HS.sql "DROP TABLE IF EXISTS slide") conn
140+
putStrLn "DROP TABLE IF EXISTS presentation"
141+
void $ HS.run (HS.sql "DROP TABLE IF EXISTS presentation") conn
140142
putStrLn "DROP TABLE IF EXISTS deck"
141143
void $ HS.run (HS.sql "DROP TABLE IF EXISTS deck") conn
142144
putStrLn "DROP TABLE IF EXISTS db_meta"
@@ -187,10 +189,10 @@ testPresDeploys = withQueueName $ withEnv $ \env -> withSQS env $ withS3 env $ d
187189
, deckAttributes = HMS.singleton "foo" "bar"
188190
}
189191

190-
deployPresentation env (Username "josph") newDeck [someSlide]
192+
deployPresentation env (Username "josph") $ deckToPres newDeck [someSlide]
191193
-- XXX: tests the obj diffing by making sure we can upload a presentation
192194
-- twice without errors
193-
deployPresentation env (Username "josph") newDeck [someSlide]
195+
deployPresentation env (Username "josph") $ deckToPres newDeck [someSlide]
194196
where
195197
testQueueName = "the-queue"
196198
withQueueName =
@@ -589,6 +591,8 @@ slidesGetSlideId' :: T.Text -> DeckId -> SlideId -> ClientM (Item SlideId Slide)
589591
slidesPost' :: T.Text -> DeckId -> Slide -> ClientM (Item SlideId Slide)
590592
slidesPut' :: T.Text -> DeckId -> SlideId -> Slide -> ClientM (Item SlideId Slide)
591593
slidesDelete' :: T.Text -> DeckId -> SlideId -> ClientM ()
594+
_presentationsPost' :: T.Text -> PresentationInfo -> ClientM (Item PresentationId PresentationResult)
595+
_presentationsPut' :: T.Text -> PresentationId -> PresentationInfo -> ClientM (Item PresentationId PresentationResult)
592596
((
593597
usersGet' :<|>
594598
_usersGetUserId' :<|>
@@ -609,6 +613,10 @@ slidesDelete' :: T.Text -> DeckId -> SlideId -> ClientM ()
609613
slidesPost' :<|>
610614
slidesPut' :<|>
611615
slidesDelete'
616+
) :<|>
617+
(
618+
_presentationsPost' :<|>
619+
_presentationsPut'
612620
)
613621
) = client api
614622

0 commit comments

Comments
 (0)