$ score-compose generate score.yaml
INFO: Loaded state directory with docker compose project '12-mysql-database'
INFO: Validated workload 'hello-world'
INFO: Successfully loaded 10 resource provisioners
INFO: mysql.default#hello-world.db: mysql.default#hello-world.db: To connect to mysql, enter password 'vOB0YIS5ToOihZXr' at: "docker run -it --network 12-mysql-database_default --rm mysql:8 mysql -h mysql-oeD62h -u user-iPVvhkqZ -p"
INFO: Provisioned 1 resources
INFO: Converting workload 'hello-world' to Docker compose
And docker compose up returns:
[+] Running 4/2
✔ Network 12-mysql-database_default Created
✔ Container 12-mysql-database-mysql-oeD62h-1 Created
✔ Container 12-mysql-database-wait-for-resources-1 Created
✔ Container 12-mysql-database-hello-world-first-1 Created
The hello world container contains the connection string
$ docker exec -it 4502cbe09933 sh -c 'echo $CONNECTION_STRING'
mysql://user-iPVvhkqZ:vOB0YIS5ToOihZXr@mysql-oeD62h:3306/dbpLOcppIB
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] New chore (expected functionality to be implemented)
Checklist:
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[x] I've signed off with an email address that matches the commit author.
Description
This pull request is a proposal for solving the issue #128.
What does this PR do?
This pull request implements a provisioner that prepares a service with MySQL (image
mysql:8
) with the corresponding parameters.This provisions a single mysql container with persistent data and healthcheck. An exec command is provided to support working with the data.
score.yaml:
generate:
And docker compose up returns:
The hello world container contains the connection string
Types of changes
Checklist: