From c65ff056090e963624f12914d9d75579274c38ac Mon Sep 17 00:00:00 2001
From: Stefan Pandzic <stefan.pandzic>
Date: Fri, 13 Dec 2024 13:46:31 +0100
Subject: [PATCH] added pipeline file

---
 backendAWS/bin/backend_aws.ts    |  1 -
 backendAWS/lib/frontend_stack.ts |  6 +-----
 buildspec.yml                    | 15 +++++++++++++++
 3 files changed, 16 insertions(+), 6 deletions(-)
 create mode 100644 buildspec.yml

diff --git a/backendAWS/bin/backend_aws.ts b/backendAWS/bin/backend_aws.ts
index af545c1..bf2d2b0 100644
--- a/backendAWS/bin/backend_aws.ts
+++ b/backendAWS/bin/backend_aws.ts
@@ -43,6 +43,5 @@ new ApiGatewayStack(app, 'ContactApp-ApiGatewayStack', {
 });
 
 new FrontendStack(app, 'ContactApp-FrontendStack', {
-  contactsBucket: storageStack.contactsBucket,
   env,
 });
diff --git a/backendAWS/lib/frontend_stack.ts b/backendAWS/lib/frontend_stack.ts
index 6a336d5..64bab4d 100644
--- a/backendAWS/lib/frontend_stack.ts
+++ b/backendAWS/lib/frontend_stack.ts
@@ -5,14 +5,10 @@ import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment';
 import { S3StaticWebsiteOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
 import { join } from 'path';
 
-interface FrontendStackProps extends cdk.StackProps {
-  contactsBucket: s3.Bucket;
-}
-
 export class FrontendStack extends cdk.Stack {
   public readonly cloudfrontDistribution: cloudfront.Distribution;
 
-  constructor(scope: cdk.App, id: string, props: FrontendStackProps) {
+  constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
     super(scope, id, props);
 
     // Create an S3 bucket for the frontend
diff --git a/buildspec.yml b/buildspec.yml
new file mode 100644
index 0000000..327bd1a
--- /dev/null
+++ b/buildspec.yml
@@ -0,0 +1,15 @@
+version: 0.2
+
+phases:
+  install:
+    runtime-versions:
+      nodejs: 20
+    commands:
+      - npm install
+  build:
+    commands:
+      - npm run build
+artifacts:
+  files:
+    - '**/*'
+  base-directory: frontend/build
-- 
GitLab