Setup CI/CD for your Spring boot project on Gitlab using maven docker image

preview_player
Показать описание
You can define your stages. Here I am going for:
1) Build
2) Test
3) Package
4) Deploy
The deployment stage is versatile. You can deploy your repository on any external machine.
Рекомендации по теме
Комментарии
Автор

The first yml file -->
image: maven:latest

stages:
- build
- test
- package
- deploy

build-job:
stage: build
script:
- "cd cicd/cicd"
- echo "Compiling the code..."
- "mvn compile"
- echo "Compile complete."

test-job:
stage: test
script:
- "cd cicd/cicd"
- echo "Running unit tests.."
- "mvn test"

package-job:
stage: test
script:
- "cd cicd/cicd"
- echo "Package the code"
- "mvn package"

deploy-job:
stage: deploy
script:
- echo "Deploying application..."
- echo "Application successfully deployed."

anirudhhosur
Автор

Make more videos please. Drop yaml file links below the group

cliff_odume
Автор

The second yml file -->
image: maven:latest

stages:
- build
- test
- package
- deploy

before_script:
- cd cicd/cicd

build-job:
stage: build
script:
- echo "Compiling the code..."
- mvn compile
- echo "Compile complete."
only:
- develop

test-job:
stage: test
script:
- echo "Running unit tests..."
- mvn test
only:
- develop

package-job:
stage: package
script:
- echo "Packaging the code..."
- mvn package
only:
- develop

deploy-job:
stage: deploy
script:
- echo "Deploying application..."
- echo "Application successfully deployed."
only:
- develop

anirudhhosur
join shbcf.ru