2017–2027Celebrating Our 10th Year

Transform Your Career.
Engineer Your Future.

15 weeks of live AI-enabled DevSecOps and cloud training with Coach AK. Build skills through 70+ hands-on labs.

Coach AK in his DevOps learning studio
Coach AK | Ananth KannanSenior DevOps & SRE Architect • Founder, CoachDevOps
3,500+Students Trained
25+ YearsIT Experience
15 WeeksLive Training
70+Hands-on Labs

Master In-Demand Technologies

AWSAzureDockerKubernetesTerraformJenkinsGitHub ActionsAnsibleGitLab

AI-Enabled DevSecOps & Cloud Engineering Bootcamp

Next weekend batch: December 5, 2026
Saturday 9:30–11:30 AM CST • Sunday 10:30 AM–12:30 PM CST

Live classes, practical projects, personal mentorship and career preparation.

View Program Details →

Real Students. Real Success.

Career milestones shared by our students.

✓ Placement in an AI role
“The concepts you taught have improved my technical understanding and confidence.”
ManimaranJuly 2026 Bootcamp
✓ DevSecOps Engineer offer
“I want to sincerely thank you for your mentorship, training, and support.”
Femi AshayeCoachDevOps Alumni
✓ DevOps Engineer offer
“I got an offer for Devops engineer Last week and happy to inform you. I really appreciate you.”
EbenezerCoachDevOps Alumni
View All Success Stories →

Individual student experiences; employment is not guaranteed.

Ready to Take the Next Step?

Explore the program or get answers to your questions before enrolling.

Saturday, June 6, 2026

How to Build and Deploy a Java Web App Using GitLab CI/CD | GitLab Pipeline Tutorial

Introduction - Gitlab CICD Pipeline

In this lab, we will create a GitLab CI/CD pipeline that automatically builds a Java web application using Maven and deploys the generated WAR file to Tomcat.

Pipeline flow:

Developer → GitLab Repository → GitLab CI/CD Pipeline → GitLab Runner → Maven Build → WAR Artifact → Deploy → Tomcat → Web Application

What is GitLab CICD?

GitLab CI/CD automates the software delivery process whenever developers push code to a GitLab repository.

A GitLab CI/CD pipeline can automate:

  • Building the application
  • Running tests
  • Performing security and code-quality scans
  • Creating artifacts
  • Deploying the application

The .gitlab-ci.yml file defines the GitLab CI/CD pipeline and is stored in the root of your GitLab repository.

It defines:

  • Pipeline stages
  • Jobs
  • Container images
  • Commands/scripts
  • Variables
  • Artifacts
  • Deployment instructions

When code is pushed to GitLab, GitLab reads the .gitlab-ci.yml file and schedules the jobs for execution by a GitLab Runner.

GitLab automatically reads this file whenever code changes are pushed into the repository. In this lab, GitLab Runner uses a Docker container image to run the job,

What is a GitLab Runner?

A GitLab Runner is the execution engine that actually runs the CI/CD jobs defined in .gitlab-ci.yml.

In this lab, the runner uses different Docker images for different jobs:

Build job: maven:3.8.6-eclipse-temurin-11
Deploy job: curlimages/curl:latest

Pre-requisites:

Configure Tomcat credentials in GitLab

Add Tomcat user, Tomcat Password and Tomcat URL as Variables in GitLab
Go to your GitLab Repo --> Click on Settings --> CICD --> Variables

Create .gitlab-ci.yml for implementing CICD using GitLab

stages:

  - build

  - deploy

build_war:

  stage: build

  image: maven:3.8.6-eclipse-temurin-11

  script:

    - echo "Building WAR file using Maven"

    - mvn clean install -f MyWebApp/pom.xml

    - echo "Listing target directory"

    - ls -la MyWebApp/target

  artifacts:

    paths:

      - MyWebApp/target/*.war

    expire_in: 1 hour

deploy_to_tomcat:

  stage: deploy

  image: curlimages/curl:latest

  dependencies:

    - build_war

  script:

    - echo "Deploying WAR file to Tomcat running on AWS EC2"

    - |
      curl -v -u ${TOMCAT_USER}:${TOMCAT_PASSWORD} \
      -T MyWebApp/target/MyWebApp.war \
      "http://${TOMCAT_HOST}/manager/text/deploy?path=/MyWebApp&update=true"

You can access Pipeline:


What happens when the pipeline runs?

1. Developer pushes code → GitLab

GitLab detects .gitlab-ci.yml and creates a pipeline.

2. GitLab Runner picks up build_war

The Runner starts the Maven container:

maven:3.8.6-eclipse-temurin-11

Maven compiles, tests, packages the application and generates:

MyWebApp.war

3. WAR is stored as a GitLab artifact

MyWebApp/target/MyWebApp.war

4. Runner executes deploy_to_tomcat

A lightweight curl container is started:

curlimages/curl:latest

5. WAR is deployed to Tomcat

The pipeline calls the Tomcat Manager API and uploads the WAR file.

Verify the deployment

After the pipeline completes successfully, open:

http://<TOMCAT-PUBLIC-DNS>:8080/MyWebApp

You should see the deployed Java web application.

You can access lab video:

Join the Discussion

Have a question about this tutorial or need help with a lab? Share your questions and feedback below.

1 comment: