DevOps Pokročilý
GitLab CI — Pokročilé Pipeline¶
GitLab CICI/CDDevOpsPipeline 5 min čtení
GitLab CI pokročilé techniky: DAG pipelines, child pipelines, includes a review apps.
DAG Pipelines¶
stages:
- build
- test
- deploy
build-frontend:
stage: build
script: npm run build
build-backend:
stage: build
script: go build -o app
test-frontend:
stage: test
needs: [build-frontend]
script: npm test
test-backend:
stage: test
needs: [build-backend]
script: go test ./...
deploy:
stage: deploy
needs: [test-frontend, test-backend]
script: kubectl apply -f k8s/
Child Pipelines & Includes¶
include:
- project: 'devops/ci-templates'
file: '/templates/docker-build.yml'
- local: '.gitlab/security.yml'
trigger-microservices:
trigger:
include:
- local: services/api/.gitlab-ci.yml
- local: services/worker/.gitlab-ci.yml
strategy: depend
Review Apps¶
deploy-review:
stage: deploy
script:
- helm upgrade --install review-$CI_COMMIT_REF_SLUG ./chart
--set image.tag=$CI_COMMIT_SHA
--set ingress.host=$CI_COMMIT_REF_SLUG.review.example.com
environment:
name: review/$CI_COMMIT_REF_SLUG
url: https://$CI_COMMIT_REF_SLUG.review.example.com
on_stop: stop-review
auto_stop_in: 1 week
rules:
- if: $CI_MERGE_REQUEST_IID
Shrnutí¶
GitLab CI s DAG pipelines, child pipelines a review apps umožňuje škálovatelné a rychlé pipeline.
Potřebujete pomoct s implementací?¶
Náš tým má zkušenosti s návrhem a implementací moderních architektur. Rádi vám pomůžeme.