This post has already been read 2665 times!
I have talked about Database Change Management using Liquibase. Now, I will talk about the integration with Jenkins CI.
As you can see in the example of my previous post. In the
pom.xml there are 3 profiles:
rollback which will be used by Jenkins. The profile approach will be useful in our integration.
I am going to use Cloudbees (PaaS)
1. First, you need to have an Cloudbees account.
2. Click on Databases and then click Add Database.
3. Create a liquibase_demo database.
4. Click on Builds, Jenkins dashboard will be display.
5. Create New Job.
6. Put a name, choose Build a free-style software project option and then click OK.
7. Now, let start to configure Jenkins’s job. You will be able to see the image below
8. Check This build is parameterized option. Then, click Add Parameter. Add the following parameters:
tag are String Parameter
password is a Password Parameter.
action is a Choice Parameter with the following options:
9. Now, lets configure the Source Code Management. In this example, I have published the demo in GitHub.
10. Now, go to Build section, click on Add build step and choose Invoke top-level Maven targets. Add the maven’s goal and properties. Then, Save.
1 2 3 4 5 6 7 8
If you remember, we have created parameters at the beginning of this post which are reusing in this part using
$ in order to do a dynamic job.
11. Finally, click Build with parameters, test your job and enjoy.
Avoid risks and say good bye to manual tasks. For that reason, I love automation!
Note: Liquibase can be used inside the java application using spring integration.