- Shell 100%
| bin | ||
| docker | ||
| elixir | ||
| helm | ||
| nodejs | ||
| python | ||
| semantic-release | ||
| shell | ||
| workflows | ||
| .editorconfig | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| CODEOWNERS | ||
| elixir-docker-container.yml | ||
| elixir-package.yml | ||
| LICENSE | ||
| nextjs-docker-container.yml | ||
| nodejs-docker-container.yml | ||
| nodejs-package.yml | ||
| prepare-renovate-pipeline.yml | ||
| python-docker-container.yml | ||
| python-package-poetry.yml | ||
| python-package.yml | ||
| README.md | ||
| release.yml | ||
| renovate.json | ||
| run-renovate-pipeline.yml | ||
| sync-branches.yml | ||
| update-workers-readme.yml | ||
NLdoc CI Pipelines
A collection of reusable GitLab CI/CD pipeline templates for NLdoc projects. This repository provides standardized CI/CD workflows for various technology stacks including Node.js, Python, Elixir, and Docker containers.
Overview
This repository contains shared CI/CD pipeline templates that can be included in NLdoc projects to provide consistent build, test, lint, security audit, and deployment workflows. The pipelines support multiple technology stacks and include automated semantic versioning and release management.
Supported Technology Stacks
- Node.js: npm-based projects with build, test, lint, and publish workflows
- Python: pip and Poetry-based projects with testing and packaging
- Elixir: Mix-based projects with compilation, testing, and Hex publishing
- Docker: Container build and publish workflows for various base images
- Helm: Kubernetes Helm chart validation and packaging
Getting Started
Prerequisites
- GitLab CI/CD environment
- Access to the NLdoc GitLab group
- Project configured with appropriate technology stack
Basic Usage
Include the relevant pipeline template in your project's .gitlab-ci.yml:
Node.js Package Project
include:
- project: "${CI_PROJECT_ROOT_NAMESPACE}/nldoc/ci/pipelines"
ref: "main"
file: "/nodejs-package.yml"
Python Package Project
include:
- project: "${CI_PROJECT_ROOT_NAMESPACE}/nldoc/ci/pipelines"
ref: "main"
file: "/python-package.yml"
inputs:
python-package-name: "your-package-name"
Elixir Package Project
include:
- project: "${CI_PROJECT_ROOT_NAMESPACE}/nldoc/ci/pipelines"
ref: "main"
file: "/elixir-package.yml"
inputs:
beforeMixDeps:
- mix local.hex --force
- mix local.rebar --force
Docker Container Project
include:
- project: "${CI_PROJECT_ROOT_NAMESPACE}/nldoc/ci/pipelines"
ref: "main"
file: "/nodejs-docker-container.yml"
Available Pipeline Templates
Package Templates
nodejs-package.yml- Node.js npm package workflowpython-package.yml- Python package workflow (pip)python-package-poetry.yml- Python package workflow (Poetry)elixir-package.yml- Elixir package workflow
Container Templates
nodejs-docker-container.yml- Node.js Docker container workflownextjs-docker-container.yml- Next.js Docker container workflowpython-docker-container.yml- Python Docker container workflowelixir-docker-container.yml- Elixir Docker container workflow
Utility Templates
workflows/generic.yml- Generic workflow rules and stagesrelease.yml- Semantic release workflowprepare-renovate-pipeline.yml- Renovate dependency managementrun-renovate-pipeline.yml- Execute Renovate updatessync-branches.yml- Branch synchronization workflow
Individual Job Templates
Node.js Jobs
nodejs/npm-install.yml- Install npm dependenciesnodejs/npm-run-build.yml- Run build scriptnodejs/npm-run-lint.yml- Run lintingnodejs/test.yml- Run testsnodejs/npm-audit.yml- Security auditnodejs/npm-combined.yml- Combined workflow
Python Jobs
python/test.yml- Run Python testspython/build-package.yml- Build Python packagepython/audit.yml- Security audit
Elixir Jobs
elixir/build.yml- Compile Elixir projectelixir/test.yml- Run testselixir/lint.yml- Run linting (Credo, etc.)elixir/publish.yml- Publish to Hex.pmelixir/audit.yml- Security audit
Helm Jobs
helm/helm-check.yml- Validate Helm chartshelm/helm-package.yml- Package Helm charts
Shell Jobs
shell/shellcheck.yml- Shell script linting
Pipeline Stages
The pipeline templates use a standard set of stages:
- dependencies - Install and cache dependencies
- build - Compile/build the project
- test - Run tests and generate coverage reports
- release - Create semantic releases and tags
- publish - Publish packages/containers to registries
- administration - Post-deployment tasks and cleanup
Semantic Release
All pipeline templates include automatic semantic versioning using semantic-release. The release process:
- Analyzes commit messages to determine version bumps
- Generates changelogs automatically
- Creates Git tags and releases
- Publishes packages to appropriate registries
Supported Release Configurations
nodejs-package.releaserc- npm package releasespython-package.releaserc- PyPI package releasespython-package-poetry.releaserc- Poetry-based PyPI releaseselixir-package.releaserc- Hex.pm package releases*-docker-container.releaserc- Container registry releases
Dependency Management
Automated dependency updates are handled via Renovate:
renovate.json- Renovate configurationprepare-renovate-pipeline.yml- Prepare Renovate updatesrun-renovate-pipeline.yml- Execute Renovate updates
Development
Local Setup
-
Clone the repository:
git clone https://gitlab.com/logius/nldoc/ci/pipelines.git cd pipelines -
Test pipeline templates locally using GitLab CI/CD tools or validation scripts
Adding New Templates
- Create new pipeline files in the appropriate directory
- Follow existing naming conventions
- Include proper documentation and examples
- Test with sample projects before merging
Usage Examples
Custom Pipeline Extension
You can extend the base templates with additional jobs:
include:
- project: "${CI_PROJECT_ROOT_NAMESPACE}/nldoc/ci/pipelines"
ref: "main"
file: "/nodejs-package.yml"
# Add custom integration tests
integration_test:
stage: test
script:
- npm run integration-test
needs: ["test"]
Contributing
We welcome contributions! Please ensure:
- All pipeline templates follow GitLab CI/CD best practices
- Templates are tested with real projects
- Documentation is updated for new features
- Semantic release configurations are properly configured
License
This project is licensed under the European Union Public License 1.2 - see LICENSE for details.
Support
For questions or issues:
- Create an issue in this repository
- Check the GitLab CI/CD documentation
- Review existing pipeline templates for examples