CICD YML file Learnings!
In our project, we automated database deployments by integrating Liquibase with GitLab CI/CD. We structured the repository with environment-specific folders and a master changelog, ensuring version-controlled schema changes. The pipeline runs nightly with three stages — Pre-DB (backups, validations, SQL preview), DB (Liquibase update & tagging), and Post-DB (data fixes, stats gathering, recompiling invalid objects). Database credentials and JDBC drivers are securely managed through CI variables and artifacts. Each changeset includes rollback scripts and is previewed using liquibase updateSQL before execution, reducing production risks. Scheduled pipelines are configured with proper rules, and logs and previews are stored as artifacts for auditing. This approach minimized manual effort, improved reliability, and ensured consistent database deployments across environments.
Gitlab cicd pipeline Build automation
In GitLab, a scheduled pipeline allows automated execution of jobs at specific times using cron expressions. The .gitlab-ci.yml file defines the pipeline’s structure, including stages, jobs, and the scripts to run. Each job can specify rules or only: [schedules] to control when it runs, ensuring scheduled jobs don’t trigger on pushes or merge requests. When a schedule is created in the GitLab UI, it targets a branch and defines the timing and optional variables. At the scheduled time, GitLab triggers a pipeline on the selected branch with CI_PIPELINE_SOURCE="schedule". The runner picks up jobs whose rules match the scheduled context and executes the defined scripts. Job logs and statuses are captured in GitLab for monitoring and debugging. Variables defined in the schedule are passed into the pipeline, allowing dynamic configuration. Using stages ensures jobs execute in the intended order even in complex pipelines. Overall, this integration provides a reliable, automated mechanism for running repetitive tasks without manual intervention. By combining .gitlab-ci.yml rules and GitLab schedules, teams can fully control what runs and when, maintaining flexibility and efficiency in CI/CD workflows.
Summary-
Constructed and refined GitLab CI/CD pipelines (YAML-based) to automate execution of PL/SQL scripts and database changes, eliminating manual interventions.
Top comments (0)