GitLab then shows a dashboard of deployments, and you can roll back from the UI. For secure cluster access, use the GitLab Agent instead of storing kubeconfig .
test: script: npm test artifacts: reports: junit: junit.xml paths: - coverage/ expire_in: 1 week GitLab can even display test reports directly in merge requests! One of the most powerful automation patterns is building and pushing Docker images. Example: Build and Push to GitLab Container Registry stages: - build-image - scan - deploy variables: IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA automating devops with gitlab ci/cd pipelines read online
test_job: stage: test script: - npm run test GitLab then shows a dashboard of deployments, and
deploy_staging: stage: deploy script: kubectl apply -f k8s/staging/ environment: name: staging url: https://staging.myapp.com deploy_prod: stage: deploy script: kubectl apply -f k8s/prod/ environment: name: production url: https://myapp.com rules: - if: $CI_COMMIT_TAG One of the most powerful automation patterns is
curl --request POST --form "token=$CI_JOB_TOKEN" --form "ref=main" "https://gitlab.com/api/v4/projects/123/trigger/pipeline" This allows external systems (monitoring, chatops) to start pipelines. DevOps automation must include security. GitLab provides native security scanning. SAST (Static Application Security Testing) Add to your pipeline: