File tree 4 files changed +42
-4
lines changed
4 files changed +42
-4
lines changed Original file line number Diff line number Diff line change @@ -39,10 +39,38 @@ jobs:
39
39
- run :
40
40
name : Nix build
41
41
command : |
42
- ls
43
- pwd
44
42
./script/test
45
43
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
+
46
74
workflows :
47
75
version : 2
48
76
build :
Original file line number Diff line number Diff line change 16
16
17
17
publicKey = builtins . readFile ./public.cer ;
18
18
19
+ swaggerUi = pkgs . runCommand "swagger-ui" { }
20
+ ''
21
+ mkdir -p $out
22
+ ${ handler } /bin/swagger $out
23
+ '' ;
24
+
19
25
googleResp = { "key1" = publicKey ; } ;
20
26
21
27
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
10
10
import qualified Servant as Servant
11
11
import qualified Servant.Swagger as Servant
12
12
import qualified Servant.Swagger.UI.Extended as Servant
13
+ import System.Environment (getArgs )
13
14
14
15
type SwaggerAPI = Servant. SwaggerSchemaUI " swagger-ui" " swagger.json"
15
16
16
17
swaggerApi :: Proxy SwaggerAPI
17
18
swaggerApi = Proxy
18
19
19
20
main :: IO ()
20
- main = serveSwagger
21
+ main = do
22
+ [dir] <- getArgs
23
+ dumpSwagger dir
21
24
22
25
swagger :: Swagger. Swagger
23
26
swagger = 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" {
60
60
]
61
61
62
62
resources = [
63
- " ${ aws_dynamodb_table . deckdeckgo-test-dynamodb-table . arn } " ,
63
+ " ${ aws_dynamodb_table . deckdeckgo-test-dynamodb-table-decks . arn } " ,
64
64
" ${ aws_dynamodb_table . deckdeckgo-test-dynamodb-table-slides . arn } " ,
65
+ " ${ aws_dynamodb_table . deckdeckgo-test-dynamodb-table-users . arn } " ,
65
66
]
66
67
}
67
68
You can’t perform that action at this time.
0 commit comments