Cloud Native 16 min read

End-to-End Project Delivery with GitLab: From Issue Creation to Deployment Pipelines

This guide details a complete GitLab‑based CI/CD workflow that starts with issue and milestone creation, defines feature‑branch pipelines, builds and tests Java applications, performs code analysis, creates Docker images, and deploys to Kubernetes with controlled pipeline triggers and rollback strategies.

DevOps Cloud Academy
DevOps Cloud Academy
DevOps Cloud Academy
End-to-End Project Delivery with GitLab: From Issue Creation to Deployment Pipelines

The document describes a full‑stack GitLab CI/CD implementation for a Java service, covering the entire lifecycle from requirement preparation to production deployment.

1. Overall Planning – The workflow begins with creating issues, linking them to milestones, and generating feature branches whose names follow a numeric convention.

2. Requirement Preparation – Milestones are created, and for each issue a corresponding feature branch is opened.

3. Pipeline Preparation – Templates and reusable jobs are stored in a separate repository. Example template inclusion:

include:
  - project: 'cidevops/cidevops-newci-service'
    ref: master
    file: 'jobs/build.yml'
  - project: 'cidevops/cidevops-newci-service'
    ref: master
    file: 'jobs/test.yml'
  - project: 'cidevops/cidevops-newci-service'
    ref: master
    file: 'jobs/codeanalysis.yml'

4. Submit Pipeline Design – Developers push code to a feature branch, triggering a pipeline that compiles, tests, scans, builds a Docker image, and deploys to a dedicated feature environment. The stages are:

.build:
  stage: build
  script:
    - ${BUILD_SHELL}
.test:
  stage: test
  script:
    - ${TEST_SHELL}
.code_analysis:
  stage: code_analysis
  script:
    - sonar-scanner ${GLOBAL_PROJECT_ARGS} ${GLOBAL_SERVER_ARGS} ${SONAR_SCAN_ARGS}

5. Build Image Stage – After a successful build, a Docker image is created and pushed:

.build-docker:
  stage: buildimage
  script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWD $CI_REGISTRY
    - docker build -t ${IMAGE_NAME} -f ${DOCKER_FILE_PATH} .
    - docker push ${IMAGE_NAME}
    - docker rmi ${IMAGE_NAME}

6. Kubernetes Deployment Stage – Deployment manifests are templated and applied with kubectl . Example deployment job:

.deploy_k8s:
  stage: deploy
  script:
    - kubectl config set-cluster my-cluster --server=${KUBE_URL} --certificate-authority="${KUBE_CA_PEM_FILE}"
    - kubectl config set-credentials admin --token=${KUBE_TOKEN}
    - sed -i "s#__namespace__#${NAMESPACE}#g" ${DEPLOY_FILE}
    - sed -i "s#__appname__#${APP_NAME}#g" ${DEPLOY_FILE}
    - sed -i "s#__imagename__#${IMAGE_NAME}#g" ${DEPLOY_FILE}
    - kubectl apply -f ${DEPLOY_FILE}
  environment:
    name: "${ENV_NAME}"
    url: "http://${ENV_NAME}.${CI_PROJECT_NAMESPACE}.${CI_PROJECT_NAME}.devops.com"
    on_stop: "${ROLL_NAME}"

7. Pipeline Trigger Control – Workflow rules prevent pipelines from running on newly created branches (where CI_COMMIT_BEFORE_SHA is all zeros) and enable manual triggers for release branches:

workflow:
  rules:
    - if: $CI_COMMIT_BEFORE_SHA == "0000000000000000000000000000000000000000"
      when: never
    - when: always

Additional rules allow merge‑request pipelines and web‑triggered pipelines, and restrict automatic execution for feature branches unless manually approved.

8. Post‑Release Steps – After a successful release, the version branch is merged into master , a Git tag is created, and related issues and milestones are closed.

The guide concludes with a reminder to follow the DevOps Cloud Academy for more practical examples.

Cloud NativedockerCI/CDKubernetesDevOpsGitLab CIPipeline Automation
DevOps Cloud Academy
Written by

DevOps Cloud Academy

Exploring industry DevOps practices and technical expertise.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.