Mstar0816 / Portfolio

https://my-portfolio-ten-orpin-68.vercel.app
1 stars 0 forks source link

Whjat is the reccomended flow to reuse the appspec and buildspec files in multiple projects withouty copy-paste? #12

Open Mstar0816 opened 4 months ago

Mstar0816 commented 4 months ago

In my curent work I reed to resuse the buildspec.yml and appspec.yml across multiple projects. The isea is that I develop software for clients using the same framework.

For deployment and building I need to follow similar steps and the only thing that changes are the deployment locations upon the server. Is there a tool that having a some templates for buildspec.yml and appspec.yml to bootstrap me the nessesary files for it in a laravel project?

I want to have a reliable way to have the buildspec.yml and appspec.yml avoiding the need to copy-paste that may lead into waste of time for debugging.

I want to boostrap the deployment ASAP.

Mstar0816 commented 4 months ago

Create a file named .env.example in your project's root directory with placeholder values for the following:

AWS_DEFAULT_REGION: The AWS region you're deploying to (e.g., us-east-1)

PROJECT_NAME: Your project name (e.g., my-laravel-app)

CODEBUILD_BUILD_IMAGE: The Docker image for building your project (e.g., php:8.1)

CODEDEPLOY_DEPLOYMENT_GROUP: The name of your CodeDeploy deployment group

CODEDEPLOY_APPLICATION_NAME: The name of your CodeDeploy application

CODEDEPLOY_SERVICE_ROLE_ARN: The ARN of the IAM role used by CodeDeploy

In your project's .gitignore file, add .env.example to prevent accidental commit.

Mstar0816 commented 4 months ago

version: 0.2

phases: install: runtime-versions: php: ${CODEBUILD_BUILD_IMAGE} # Use environment variable for build image commands:

artifacts: files: