Skip to content

Instantly share code, notes, and snippets.

@ravishtiwari
Last active November 25, 2017 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ravishtiwari/966e2537373aec97c398b836fae0c474 to your computer and use it in GitHub Desktop.
Save ravishtiwari/966e2537373aec97c398b836fae0c474 to your computer and use it in GitHub Desktop.
AWS Codepipeline templates
version: 0.2
phases:
install:
commands:
- echo Restore started on `date`
- 'dotnet restore'
- echo Restore completed on `date`
build:
commands:
- echo Build started on `date`
- 'dotnet build -c Release OpenApi/OpenApi.csproj'
- 'dotnet publish -c Release OpenApi/OpenApi.csproj'
- cp -v sam-template.yaml OpenApi/bin/Release/netcoreapp1.0/publish/template.yaml
- cd OpenApi/bin/Release/netcoreapp1.0/publish/
- aws cloudformation package --template-file template.yaml --s3-bucket $S3_BUCKET --output-template-file template-export.yaml
- mv -v template-export.yaml ../../../../../template-export.yaml
- echo Build complete on `date`
artifacts:
type: zip
files:
- template-export.yaml
AWSTemplateFormatVersion: 2010-09-09
Transform:
- AWS::Serverless-2016-10-31
Resources:
OpenAPI:
Type: AWS::Serverless::Function
Properties:
Handler: OpenApi::OpenApi.LambdaEntryPoint::FunctionHandlerAsync
Runtime: dotnetcore1.0
Timeout: 30
MemorySize: 256
Events:
GetEvent:
Type: Api
Properties:
Path: /{proxy+}
Method: ANY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment