1 Answer
- Newest
- Most votes
- Most comments
1
This should do the trick Remember to configure your Sequelize ORM to connect to this test database when running in the AWS CodeBuild environment. You can use environment variables to manage your database connection details securely.
version: 0.2
phases:
install:
runtime-versions:
nodejs: 12
commands:
- echo Installing source NPM dependencies...
- npm install
- echo Installing MySQL...
- sudo yum update -y
- sudo yum install -y mysql-server mysql
pre_build:
commands:
- echo Starting MySQL...
- sudo service mysqld start
- echo Creating test database...
- mysql -u root -e 'CREATE DATABASE IF NOT EXISTS test_db;'
build:
commands:
- echo Build started on `date`
- echo Compiling the Node.js code...
- npm run build
post_build:
commands:
- echo Build completed on `date`
- echo Running tests...
- npm test
Relevant content
- Accepted Answerasked 2 months ago
- asked 4 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
Thanks but This what i get if try it
No match for argument: mysql-server No match for argument: mysql Error: Unable to find a match: mysql-server mysql
Are the packages in ? Have you installed them ?
Yes i have this is the environment am using
Pls help
You have to personalize the names in the buildspec with the name of your instances (MySQL instance and DB Name) .