Balaji Vajjala's Blog

A DevOps Blog from Trenches

04.05

  • 4.5 Script a database
    • Learning Objectives
    • EXERCISE: Run scripted database files
    • EXERCISE: Scripted Database (OPTIONAL)
    • Scripted Databases

4.5 Script a database

Learning Objectives

By the end of this lesson you will be able to:

  • Run database script as part of delivery pipeline.

EXERCISE: Run scripted database files

  1. Open database schema file from the AWSCLI instance. You can also find the file by visiting https://github.com/stelligent/sample_app/tree/master/db
  2. Add a new table called country to the create-database-mysql.sql file.
  3. Run a private build and verify that the country table was added in MySQL

    “` cd /home/ec2-user/continuous_integration_example/software/ ant mysql -h localhost -u root -p use brewery; show tables;

    “`

  4. Add, commit and push your changes to Git master.

EXERCISE: Scripted Database (OPTIONAL)

  1. Open database migration file from the AWSCLI instance. You can also find the file by visiting https://github.com/stelligent/sample_app/tree/master/db/migrate
  2. Open database configuration file from the AWSCLI instance. You can also find the file by visiting https://github.com/stelligent/sample_app/blob/master/config/database.yml

Scripted Databases

Slide1