
Gitlab Ci Job Configuration
- 1 installs
- 186 repo stars
- Updated July 19, 2026
- thebushidocollective/han
Define GitLab CI jobs, configure scripts and environments, and manage job dependencies and execution options.
About
Covers defining GitLab CI jobs including scripts, environments, and job dependencies. A developer uses it when writing or structuring individual jobs in a GitLab pipeline.
- Job structure, scripts, and environments
- Job dependencies and execution options
Gitlab Ci Job Configuration by the numbers
- 1 all-time installs (skills.sh)
- Ranked #1,173 of 1,435 DevOps & CI/CD skills by installs in the Skillselion catalog
- Data as of Aug 1, 2026 (Skillselion catalog sync)
npx skills add https://github.com/thebushidocollective/han --skill gitlab-ci-job-configurationAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 186 |
| Last updated | July 19, 2026 |
| Repository | thebushidocollective/han ↗ |
What it does
Define GitLab CI jobs, configure scripts and environments, and manage job dependencies and execution options.
Files
GitLab CI - Job Configuration
Configure GitLab CI jobs with proper scripts, environments, and execution settings.
Basic Job Structure
job_name:
stage: test
image: node:20-alpine
before_script:
- npm ci
script:
- npm test
after_script:
- echo "Cleanup tasks"
rules:
- if: $CI_COMMIT_BRANCH == "main"Script Configuration
Multi-Line Scripts
build:
script:
- echo "Building application..."
- npm run build
- echo "Build complete"Script with Exit Codes
test:
script:
- npm test || exit 1
- npm run lint
allow_failure: falseEnvironment Configuration
deploy:production:
stage: deploy
script:
- ./deploy.sh
environment:
name: production
url: https://example.com
on_stop: stop:production
rules:
- if: $CI_COMMIT_BRANCH == "main"
when: manual
stop:production:
stage: deploy
script:
- ./teardown.sh
environment:
name: production
action: stop
when: manualJob Rules
Conditional Execution
job:
rules:
- if: $CI_COMMIT_BRANCH == "main"
when: always
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: on_success
- when: neverChanges-Based Rules
test:frontend:
rules:
- changes:
- "src/frontend/**/*"
- "package.json"Exists-Based Rules
docker:build:
rules:
- exists:
- DockerfileJob Dependencies
Using Dependencies
build:
stage: build
script: npm run build
artifacts:
paths:
- dist/
test:
stage: test
dependencies:
- build
script: npm testUsing Needs (DAG)
test:unit:
needs:
- job: build
artifacts: true
script: npm run test:unitParallel Jobs
Matrix Jobs
test:
parallel:
matrix:
- NODE_VERSION: ["18", "20", "22"]
OS: ["alpine", "bullseye"]
image: node:${NODE_VERSION}-${OS}
script: npm testSimple Parallel
test:
parallel: 5
script: npm run test:shardResource Configuration
heavy_job:
tags:
- high-memory
resource_group: deploy
timeout: 2h
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failureRelated skills
DevOps & CI/CDdevops