GitLab CI/CD Setup
GitLab CI/CD is a GitLab tool that automates the process of building, testing, and deploying software changes to your repository using pipelines, which are made up of jobs and stages.
- A job is an action to the software, such as compiling, testing, and deploying code.
- A stage is a time frame in which a job is run, such as building, testing, staging, and production.
GitLab CI/CD uses runners to run jobs in a pipeline. If a runner successfully runs all jobs in a stage, the pipeline will automatically go to the next stage. If any jobs fail, the pipeline ends. For more information, see GitLab CI/CD Pipelines.
Ensure you have a GitLab account.
Note: For more information on how to create a GitLab account, see Signing Up for GitLab.
Using GitLab CI/CD for Liquibase
You can use GitLab’s shared runners for your pipelines, which will create a virtual machine for each job and delete it after the job is complete. Alternatively, you can self-host runners by installing GitLab Runner.
The LiquibaseGitLabCICD repository contains a README and files for different setup pipelines:
- Liquibase Command Line Interface (CLI)
- Liquibase Maven commands with a Springboot app
- Liquibase Gradle commands
- Liquibase running in Docker
- Liquibase running in a NodeJS wrapper
The repository contains the following configuration files for each project:
|Docker||Docker||The SQL changelog file|
|Liquibase CLI commands||H2_project||The XML changelog file|
How to Use the Liquibase GitLab CI/CD Repository
To use the Liquibase GitLab CI/CD repository, follow these steps:
- Open the repository and click the Fork button in the top-right corner of the page to create a copy for yourself. For more information about forking, see Project forking workflow.
- Go to your newly forked “liquibasegitlabcicd” repository and follow the steps on Get started with GitLab CI/CD.
- To run your job, click CI/CD on the left panel -> Pipelines -> Branches -> select a branch -> Run Pipeline.
You can adjust your CI/CD pipeline by adding more commands and flags to the