using spring boot profiles with liquibase changeset context attribute to manage changset scope
<p>I am trying to do a proof of concept application with spring boot and liquibase. I basically want to create a spring boot app that can manage liquibase changesets by utilizing the changeset attribute called context, so that changesets with no context can be applied to any spring boot profile, whereas changesets with specific context (e.g context="dev" ) will only be applied if spring boot profiles of that type, is active (e.g spring.profiles.active=dev).</p>

<p>In my app, i have the following spring profiles -> dev, prod (each specified correctly in the application yaml file with the relavant profile db credentials also specified under the profile). What do I need to do to make this work. below is my application.yaml</p>

<pre><code>spring:
  application:
    name: liquibase-spring-jpa-postgres-example
liquibase:
  change-log: db.changelog/db.changelog-master.xml

spring:
  profiles: dev
  datasource:
    url: jdbc:postgresql://localhost:5432/dev
    username: postgres
    password: password
    driver-class-name: org.postgresql.Driver

spring:
  profiles: ci
  datasource:
      url: jdbc:postgresql://localhost:5432/ci
      username: postgres
      password: password
      driver-class-name: org.postgresql.Driver

spring:
  profiles: qa
  datasource:
      url: jdbc:postgresql://localhost:5432/qa
      username: postgres
      password: password
      driver-class-name: org.postgresql.Driver

spring:
  profiles: production
  datasource:
      url: jdbc:postgresql://localhost:5432/prod
      username: postgres
      password: password
      driver-class-name: org.postgresql.Driver
</code></pre>

<p>and below is the current databaseChangeLog file (the second change set shouldn't run if my spring profile is prod).</p>

<pre><code>&lt;changeSet id="20161016_my_first_change" author="fike" context="dev, qa, ci, production"&gt;
    &lt;sql&gt;
        CREATE TABLE customer
        (
        id BIGSERIAL PRIMARY KEY,
        firstname character varying NOT NULL,
        lastname character varying NOT NULL
        );
    &lt;/sql&gt;
    &lt;rollback&gt;
        drop table customer;
    &lt;/rollback&gt;
&lt;/changeSet&gt;

&lt;changeSet id="20161016_my_first_change2" author="krudland" context="dev"&gt;
    &lt;sql&gt;
        insert into customer (firstname, lastname) values ('Franklin','Ike');
    &lt;/sql&gt;
    &lt;rollback&gt;
        delete from customer where firstname = 'Franklin' and lastname = 'Ike';
    &lt;/rollback&gt;
&lt;/changeSet&gt;
</code></pre>

<p></p>

<p>I basically need to be able to manage my liquibase context, using my spring profile. Is this possible? </p>