Optimizing Shared GitLab Pipelines: Flexibility and Maintainability — DeepSeek Blog | Neura Market
    Neura MarketNeura Market/DeepSeek
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsBlogVideosGuidesCoursesCommunityTrendingGenerate
    DeepSeekBlogOptimizing Shared GitLab Pipelines: Flexibility and Maintainability
    Back to Blog
    Optimizing Shared GitLab Pipelines: Flexibility and Maintainability
    gitlab

    Optimizing Shared GitLab Pipelines: Flexibility and Maintainability

    Romain Lespinasse February 20, 2026
    0 views

    Optimizing shared GitLab pipelines enhances flexibility and maintainability. Users can easily customize pipeline behavior by implementing variables as configuration points without compromising the original intent. While temporary workarounds exist, contributing to open-source projects to improve shared pipeline structures is highly recommended, especially during events like Hacktoberfest.

    --- title: Optimizing Shared GitLab Pipelines: Flexibility and Maintainability published: true description: Optimizing shared GitLab pipelines enhances flexibility and maintainability. Users can easily customize pipeline behavior by implementing variables as configuration points without compromising the original intent. While temporary workarounds exist, contributing to open-source projects to improve shared pipeline structures is highly recommended, especially during events like Hacktoberfest. tags: gitlab, cicd canonical_url: https://www.romainlespinasse.dev/posts/optimizing-shared-gitlab-pipelines/ --- ## The Challenge A colleague seeks to modify the script section of a job in a shared GitLab pipeline, facing hardcoded configuration: ```yaml # https://gitlab.com/rlespinasse/foobar-shared-ci-templates/-/blob/main/pipeline-with-hardcoded-values.yml test-branch: stage: test before_script: - ls script: # it's for the example, the script can be more complex - ls ./wrong-folder ``` This rigid setup causes pipeline failure in their project: ```yaml # https://gitlab.com/rlespinasse/foobar-project/-/blob/main/.gitlab-ci.yml include: - project: 'rlespinasse/foobar-shared-ci-templates' ref: HEAD file: - '/pipeline-with-hardcoded-values.yml' ``` ```shell $ ls ./wrong-folder ls: cannot access './wrong-folder': No such file or directory ``` ## Ideal Solution The optimal approach involves implementing [variables as configuration points](https://docs.gitlab.com/ee/ci/yaml/includes.html#override-included-configuration-values): ```yaml # https://gitlab.com/rlespinasse/foobar-shared-ci-templates/-/blob/main/pipeline-with-variables.yml variables: FOLDER_TO_TEST: wrong-folder test-branch: stage: test before_script: - ls script: - ls ./${FOLDER_TO_TEST} ``` This method allows for easy customization: ```yaml # https://gitlab.com/rlespinasse/foobar-project/-/merge_requests/2 include: - project: 'rlespinasse/foobar-shared-ci-templates' ref: HEAD file: - '/pipeline-with-variables.yml' variables: FOLDER_TO_TEST: folder ``` ```shell $ ls ./${FOLDER_TO_TEST} some-file ``` ## Temporary Workaround In the meantime, one can override only the `script` part: ```yaml # https://gitlab.com/rlespinasse/foobar-project/-/merge_requests/1 include: - project: 'rlespinasse/foobar-shared-ci-templates' ref: HEAD file: - '/pipeline-with-hardcoded-values.yml' test-branch: stage: test script: - ls ./folder ``` ```shell $ ls ./folder some-file ``` ## Conclusion While functional, this temporary solution may lead to divergences and maintenance issues. It's recommended to contribute to open source or innersource projects (especially during [Hacktoberfest](https://hacktoberfest.com/)) by proposing the addition of variables. This would allow users to adapt shared pipeline behaviors to their needs while preserving the original intent. ### Explore the code You can explore the code on those repositories: - <https://gitlab.com/rlespinasse/foobar-shared-ci-templates> - <https://gitlab.com/rlespinasse/foobar-project> > 💡 Note > This post was originally published on [my personal blog](https://www.romainlespinasse.dev/posts/optimizing-shared-gitlab-pipelines/).

    Tags

    gitlabcicd

    Comments

    More Blog

    View all
    How I'm using ASTs and Gemini to solve the "Codebase Onboarding" problem 🧠ai

    How I'm using ASTs and Gemini to solve the "Codebase Onboarding" problem 🧠

    Hi everyone! 👋 I’m Tara, a Senior Software Engineer and Consultant. Over the years, I've jumped...

    T
    tworrell
    Local AI Will Save Us All (The Math Says So, Trust Me)ai

    Local AI Will Save Us All (The Math Says So, Trust Me)

    Every few weeks a take goes viral in tech circles making the case for ditching cloud AI and running...

    S
    Sebastian Schürmann
    Lost in the AI Hype, I Started Smallai

    Lost in the AI Hype, I Started Small

    And it helped me get back into tech without drowning TL;DR at the end Coming back to...

    R
    Rohini Gaonkar
    Building a Replay-Tested Interactive Brokers Client in Gogo

    Building a Replay-Tested Interactive Brokers Client in Go

    I wanted an IBKR library that felt like Go and had testing I could trust. So I wrote one.

    T
    Thomas Marcelis
    Playwright in Pictures: Fully Parallel Modeplaywright

    Playwright in Pictures: Fully Parallel Mode

    Playwright’s fullyParallel mode is often treated as a simple performance switch. In practice, it...

    V
    Vitaliy Potapov
    Designing a CLI for Both Humans and Agentscli

    Designing a CLI for Both Humans and Agents

    Learn how Alpic designed its CLI for both human developers and AI agents — covering tradeoffs like polling, context windows, interactivity, and statelessness.

    J
    Julien Vallini

    Stay up to date

    Get the latest DeepSeek prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for DeepSeek and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.