This repository was archived by the owner on Feb 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +42
-4
lines changed Expand file tree Collapse file tree 4 files changed +42
-4
lines changed Original file line number Diff line number Diff line change @@ -39,10 +39,38 @@ jobs:
3939 - run :
4040 name : Nix build
4141 command : |
42- ls
43- pwd
4442 ./script/test
4543
44+ - run :
45+ name : " Update Node.js and npm"
46+ command : |
47+ nix-env -f ./nix -iA nodejs-10_x
48+
49+ - run :
50+ name : Install netlify-cli
51+ command : |
52+ npm install netlify-cli
53+
54+ - run : # TODO: shouldn't deploy to prod on every commit
55+ name : Netlify deploy
56+ command : |
57+ echo "Branch:" "$CIRCLE_BRANCH"
58+ echo "Repo:" "$CIRCLE_REPOSITORY_URL"
59+ echo "PR:" "$CIRCLE_PULL_REQUEST"
60+ if [ "$CIRCLE_BRANCH" == "master" ]; then
61+ echo "Deploying to production"
62+ ./node_modules/netlify-cli/bin/run deploy \
63+ --dir=$(nix-build -A swaggerUi --no-link) \
64+ --message="$CIRCLE_SHA1" --prod
65+ elif [ -n "$CIRCLE_PULL_REQUEST" ]; then
66+ echo "One time deploy for PR $CIRCLE_PR_NUMBER"
67+ ./node_modules/netlify-cli/bin/run deploy \
68+ --dir=$(nix-build -A swaggerUi --no-link) \
69+ --message="$CIRCLE_SHA1"
70+ else
71+ echo "Not deploying"
72+ fi
73+
4674workflows :
4775 version : 2
4876 build :
Original file line number Diff line number Diff line change 1616
1717 publicKey = builtins . readFile ./public.cer ;
1818
19+ swaggerUi = pkgs . runCommand "swagger-ui" { }
20+ ''
21+ mkdir -p $out
22+ ${ handler } /bin/swagger $out
23+ '' ;
24+
1925 googleResp = { "key1" = publicKey ; } ;
2026
2127 apiDir = pkgs . writeTextFile
Original file line number Diff line number Diff line change @@ -10,14 +10,17 @@ import qualified Network.Wai.Handler.Warp as Warp
1010import qualified Servant as Servant
1111import qualified Servant.Swagger as Servant
1212import qualified Servant.Swagger.UI.Extended as Servant
13+ import System.Environment (getArgs )
1314
1415type SwaggerAPI = Servant. SwaggerSchemaUI " swagger-ui" " swagger.json"
1516
1617swaggerApi :: Proxy SwaggerAPI
1718swaggerApi = Proxy
1819
1920main :: IO ()
20- main = serveSwagger
21+ main = do
22+ [dir] <- getArgs
23+ dumpSwagger dir
2124
2225swagger :: Swagger. Swagger
2326swagger = Servant. toSwagger (Proxy :: Proxy DeckGo.Handler. SlidesAPI )
Original file line number Diff line number Diff line change @@ -60,8 +60,9 @@ data "aws_iam_policy_document" "policy_for_lambda" {
6060 ]
6161
6262 resources = [
63- " ${ aws_dynamodb_table . deckdeckgo-test-dynamodb-table . arn } " ,
63+ " ${ aws_dynamodb_table . deckdeckgo-test-dynamodb-table-decks . arn } " ,
6464 " ${ aws_dynamodb_table . deckdeckgo-test-dynamodb-table-slides . arn } " ,
65+ " ${ aws_dynamodb_table . deckdeckgo-test-dynamodb-table-users . arn } " ,
6566 ]
6667 }
6768
You can’t perform that action at this time.
0 commit comments