Optimizing Shared GitLab Pipelines: Flexibility and…
    Neura MarketNeura Market/DeepSeek
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityDeepSeekDeepSeek
    CoPilotCoPilotStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityTrending
    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:

    # 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:

    # 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'
    
    $ 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://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:

    # 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
    
    $ ls ./${FOLDER_TO_TEST}
    some-file
    

    Temporary Workaround

    In the meantime, one can override only the script part:

    # 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
    
    $ 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) 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.

    Tags

    gitlabcicd

    Comments

    More Blog

    View all
    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught megemma

    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught me

    I ported the whole Gemma-4 family — E2B, E4B, 12B, 31B, and the 26B-A4B MoE — to run on...

    X
    xbill
    Hey DEV, I'm Tobore. Let's actually connect.community

    Hey DEV, I'm Tobore. Let's actually connect.

    Hey DEV, I'm Tobore. Let's actually connect. I've been on here for a while now, mostly writing and...

    L
    Laurina Ayarah
    I burned through thousands of AI tokens. Then a friend did it for freeai

    I burned through thousands of AI tokens. Then a friend did it for free

    (yep, kinda clickbait, just for the funsies 😊) At the beginning of the year, I relaunched my...

    P
    Paulo Henrique
    Claude might be saturating your machineai

    Claude might be saturating your machine

    My laptop was sitting idle with the fan at full tilt. Nothing was running that I knew of. The culprit...

    S
    Sidhant Panda
    Automated GitHub Code Reviews Using Google Geminigithubactions

    Automated GitHub Code Reviews Using Google Gemini

    I Built a Thing! TL;DR — Google Gemini-based Pull Request reviews and Issue Triaging for...

    D
    Darren "Dazbo" Lester
    What is an "agentic harness," actually?ai

    What is an "agentic harness," actually?

    I've been hearing the word "harness" thrown around a lot lately. I assumed it just meant "the IDE" or...

    T
    Tilde A. Thurium

    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.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions for your business.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this DeepSeek resource

    • Generate AI Viral Videos with NanoBanana & VEO3, Shared on Socials via Blotaton8n · $24.99 · Related topic
    • eBay Enhances Data Access for AI Agents with MCP Server Integrationn8n · $9.99 · Related topic
    • AI-Powered OAuth2 Configuration Discovery with Confidence Scoringn8n · $9.99 · Related topic
    • Initialize Mattermost Standup Bot Configurationn8n · $4.99 · Related topic
    Browse all workflows