Open Mstar0816 opened 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.
version: 0.2
phases: install: runtime-versions: php: ${CODEBUILD_BUILD_IMAGE} # Use environment variable for build image commands:
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
pre_build: commands:
php artisan key:generate # Generate encryption key
build: commands:
php artisan migrate --force # Run migrations
post_build: commands:
artifacts: files:
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.