Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
sehrish30 committed May 22, 2023
1 parent 639af07 commit 994f5e5
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 13 deletions.
34 changes: 28 additions & 6 deletions external-verification-service/config/deploy/buildspec.dev.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
version: 0.2

env:
variables:
ENV_NAME: dev

phases:
install:
on-failure: ABORT
runtime-versions:
nodejs: 18
commands:
- echo installing serverless cli
- npm i -g serverless
- cd external-verification-service
- echo installing npm dependecies of infra service
- npm install
- serverless plugin install --name serverless-plugin-typescript
- serverless plugin install --name serverless-apigateway-service-proxy
- serverless plugin install --name serverless-iam-roles-per-function

build:
on-failure: ABORT
commands:
- echo deployment phase
- echo $ENV_NAME
- echo Deploying
- serverless deploy --stage dev

# the file codebuild should deploy to s3
artifacts:
files:
- external-verification-service/my-artifact/*
name: myProjectArtifacts

cache:
paths:
- "external-verification-service/node_modules/**/*"
# ${env:GITHUB_TOKEN}
23 changes: 16 additions & 7 deletions external-verification-service/resources/CodePipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CodePipeline:
Category: Source
Owner: ThirdParty
Provider: GitHub
Version: "1"
Version: "1" # 2 isnot available in my region
Configuration:
Owner: !Ref GithubOwner
Repo: !Ref GithubRepository
Expand Down Expand Up @@ -141,24 +141,26 @@ CodeBuildProject:
- Name: GITHUB_TOKEN
Value: ${env:GITHUB_TOKEN}

CodeBuildDevProject:
CodeBuildDeployDevProject:
Type: AWS::CodeBuild::Project
Properties:
Name: !Sub Dev-${self:provider.stage}
ServiceRole: !GetAtt CodePipelineServiceRole.Arn
Source:
Type: CODEPIPELINE
BuildSpec: external-verification-service/config/deploy/deployspec.dev.yml
BuildSpec: external-verification-service/config/deploy/buildspec.dev.yml
# output setting of the artifact build by code build
Artifacts:
Type: CODEPIPELINE # The build project does not produce any build output.
Environment:
Type: LINUX_CONTAINER
ComputeType: BUILD_GENERAL1_SMALL
Image: !Ref CodeBuildEnvironmentImage
EnvironmentVariables:
- Name: ENV_NAME
Value: dev
# EnvironmentVariables:
# - Name: BUCKET_NAME
# Value: ${env:BUCKET_NAME}
# - Name: GITHUB_TOKEN
# Value: ${env:GITHUB_TOKEN}

CodeBuildQAProject:
Type: AWS::CodeBuild::Project
Expand Down Expand Up @@ -269,7 +271,14 @@ CodePipelineServiceRole:
- Sid: SSM
Effect: Allow
Action:
- ssm:*
- ssm:Describe
- ssm:Get*
- ssm:List*
Resource: "*"
- Sid: Cloudformation
Effect: Allow
Action:
- cloudformation:DescribeStacks
Resource: "*"

CodePipelineArtifactStore:
Expand Down
1 change: 1 addition & 0 deletions external-verification-service/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ resources:
CodeBuildSourceCredentials: ${file(./resources/CodePipeline.yml):CodeBuildSourceCredentials}
CodePipelineServiceRole: ${file(./resources/CodePipeline.yml):CodePipelineServiceRole}
CodeBuildProject: ${file(./resources/CodePipeline.yml):CodeBuildProject}
CodeBuildDeployDevProject: ${file(./resources/CodePipeline.yml):CodeBuildDeployDevProject}
# CodeBuildDevProject: ${file(./resources/CodePipeline.yml):CodeBuildDevProject}
# CodeBuildQAProject: ${file(./resources/CodePipeline.yml):CodeBuildQAProject}
# CodeBuildProdProject: ${file(./resources/CodePipeline.yml):CodeBuildProdProject}
Expand Down

0 comments on commit 994f5e5

Please sign in to comment.