title: Automate Flyway migration with Docker and Jenkins
body: <p>I'd like to automate the Flyway migrations for our MariaDB database. For testing purposes I added the following service to my <code>docker-compose.yml</code> running only the <code>info</code> command. </p>
  
  <pre><code>  flyway:
      image: boxfuse/flyway:5.2.4
      command: -url=jdbc:mariadb://mariadb_service -schemas=$${MYSQL_DATABASE} -table=schema_version -connectRetries=60 info
      volumes:
        - ./db/migration:/flyway/sql
      depends_on:
        - mariadb_service
  </code></pre>
  
  <p>This seems to be working, i.e. I can see the output of <code>info</code>.</p>
  
  <p>Now I'd like to take this idea one step further and integrate this into our Jenkins build pipeline. This is where I get stuck.</p>
  
  <ol>
  <li>If I deployed the Docker stack with the above <code>docker-compose.yml</code> in my <code>Jenkinsfile</code> would the corresponding stage fail upon errors during the migration? Speaking, would Jenkins notice that error?</li>
  <li>If this is not true how can I integrate the Flyway migration in my Jenkins pipeline? I found that there is a Flyway Runner plugin but I didn't see if this can connect to a database in a Docker stack deployed by the <code>Jenkinsfile</code></li>
  </ol>