location: $projeto/src/main/resources/db/migration de seu repositorio GIT. Precisaras incluir tambem as dependencias de plugins e jdbcs, tais como: JDBC mysql mysql-connector-java 5.1.21 Plugin FlywayDB com.googlecode.flyway flyway-core 1.7 com.googlecode.flyway flyway-maven-plugin 1.7 $user $passwd com.mysql.jdbc.Driver $string_de_conexao src/main/resources/db/migration org.flywaydb.sample.migration Nao esqueca que precisara de um primeiro scripts de install na database alvo, um exemplo abaixo:V0001__Install.sql CREATE TABLE t (c CHAR(20) CHARACTER SET utf8 COLLATE utf8_bin); Apos para futuras migrations utilize: V0002__Migration.sql. Estrutura de POM e aplicacao de teste disponivel em: https://github.com/helkmut/treina-auto_avanc Exemplo de saida de um Job de criacao de artefato do CI (Continuous Integration) Jenkins de um projeto Maven usando FlywayDB:Started by user anonymousBuilding in workspace /var/lib/jenkins/jobs/BUILD-treina-auto_avanc/workspaceDeleting project workspace... doneCloning the remote Git repositoryCloning repository https://github.com/helkmut/treina-auto_avanc >git init /var/lib/jenkins/jobs/BUILD-treina-auto_avanc/workspace # timeout=10Fetching upstream changes from https://github.com/helkmut/treina-auto_avanc >git --version # timeout=10using .gitcredentials to set credentials >git config --local credential.helper store --file=/tmp/git1715435271723825466.credentials # timeout=10 >git -c core.askpass=true fetch --tags --progress https://github.com/helkmut/treina-auto_avanc+refs/heads/*:refs/remotes/origin/* >git config --local --remove-section credential # timeout=10 >git config remote.origin.url https://github.com/helkmut/treina-auto_avanc# timeout=10 >git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 >git config remote.origin.url https://github.com/helkmut/treina-auto_avanc# timeout=10Fetching upstream changes from https://github.com/helkmut/treina-auto_avancusing .gitcredentials to set credentials >git config --local credential.helper store --file=/tmp/git1240117904577578786.credentials # timeout=10 >git -c core.askpass=true fetch --tags --progress https://github.com/helkmut/treina-auto_avanc >git config --local --remove-section credential # timeout=10 >git rev-parse refs/remotes/origin/master^{commit} # timeout=10 >git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10Checking out Revision e5d07b7b9898c931fef6397d060e911e3535828c (refs/remotes/origin/master) >git config core.sparsecheckout # timeout=10 >git checkout -f e5d07b7b9898c931fef6397d060e911e3535828c >git rev-list e5d07b7b9898c931fef6397d060e911e3535828c # timeout=10[workspace] $ /bin/sh -xe /tmp/hudson7642003292037004876.sh+ git checkoutParsing POMs[app] $ /var/lib/jenkins/tools/hudson.model.JDK/Java8/bin/java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-agent-1.5.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/3.2.2/boot/plexus-classworlds-2.5.1.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/3.2.2/conf/logging jenkins.maven3.agent.Maven31Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/3.2.2 /var/cache/jenkins/war/WEB-INF/lib/remoting-2.51.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven31-interceptor-1.5.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.5.jar 41028<===[JENKINS REMOTING CAPACITY]===>channel startedExecuting Maven: -B -f /var/lib/jenkins/jobs/BUILD-treina-auto_avanc/workspace/app/pom.xml -PDev compile flyway:status[INFO] Scanning for projects...[INFO] [INFO] ------------------------------------------------------------------------[INFO] Building app 1[INFO] ------------------------------------------------------------------------[INFO][INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ app ---[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent![INFO] Copying 1 resource[INFO][INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ app ---[INFO] No sources to compile[INFO][INFO] --- flyway-maven-plugin:1.7:status (default-cli) @ app ---[INFO] +-------------+------------------------+---------------------+---------+[INFO] | Version | Description | Installed on | State |[INFO] +-------------+------------------------+---------------------+---------+[INFO] | 0001 | Install | 2015-06-15 17:22:49 | SUCCESS |[INFO] +-------------+------------------------+---------------------+---------+[INFO] ------------------------------------------------------------------------[INFO] BUILD SUCCESS[INFO] ------------------------------------------------------------------------[INFO] Total time: 2.933 s[INFO] Finished at: 2015-06-15T18:59:09+00:00[INFO] Final Memory: 11M/31M[INFO] ------------------------------------------------------------------------[JENKINS] Archiving /var/lib/jenkins/jobs/BUILD-treina-auto_avanc/workspace/app/pom.xml to com.mycompany.app/app/1/app-1.pom[workspace] $ /bin/sh -xe /tmp/hudson4990860526944688595.shchannel stopped+ tar cvf app.tar app README.mdapp/app/src/app/src/main/app/src/main/resources/app/src/main/resources/db/app/src/main/resources/db/migration/app/src/main/resources/db/migration/V0001__Install.sqlapp/index.htmlapp/MySqlDataGrid.aspx.resxapp/pom.xmlapp/target/app/target/classes/app/target/classes/db/app/target/classes/db/migration/app/target/classes/db/migration/V0001__Install.sqlapp/1web.configapp/MySqlDataGrid.aspxapp/1.htmlapp/MySqlDataGrid.aspx.csREADME.mdTriggering projects: DEV-treina-auto_avancArchiving artifactsFinished: SUCCESS Com relacao as melhores praticas de vinculacao com o CI (Continuous Integration) Jenkins em seu projeto, pipelines e demais plugins deixaremos para uma proxima publicacao, pois seria aqui uma abordagem superficial. O importante e que essa publicacao abra seus olhos para facilitar interacoes com a base de dados e a aplicacao, proporcionando um ciclo agil em ambas as camadas. Referencias:https://flywaydb.orghttps://github.com/helkmut/treina-auto_avanchttps://www.maxcdn.com/blog/cdn-framework-step-2Autores:*Gabriel Prestes e formando em Gestao da Tecnologia da Informacao, arquiteto de middleware da ilegra com experiencia de mais de 5 anos em suites de middleware Oracle e RedHat. E um entusiasta de carros antigos.DevOps Engineer com ampla experiencia como agile coach e arquiteto de infraestrutura em clouds publicas e privadas. *Cesar Mesquita possui mais de 13 anos atuando na operacao de infraestruturas de TI. Entusiasta da cultura DEVOPS, contribuindo com diversas empresas a disseminar praticas ageis entre os times de desenvolvimento e infraestrutura .Trabalha atualmente na Ilegra como arquiteto de solucoes em cloud. Fa