combine both jobs stages: - build build: stage: build tags: - ShellRunner image:…
- User
combine both jobs stages:
- build
build: stage: build tags:
- ShellRunner
image: maven:3.8-openjdk-11 # Replace with your desired Maven version
script:
-
cd defect-factor-analysis
-
mvn clean package
-
CALL echo "Building WAR file completed"
-
cd
-
CALL docker build -t DFA:1.1.1 . artifacts: paths:
- defect-factor-analysis/target/*.war
-
and stages:
- build
build: stage: build tags:
- ShellRunner
image: maven:3.8-openjdk-11 # Replace with your desired Maven version
script:
-
cd defect-factor-analysis
-
mvn clean package
-
CALL echo "Building WAR file completed"
-
cd
-
CALL docker build -t DFA:1.1.1 . artifacts: paths:
- defect-factor-analysis/target/*.war
-
- Assistant
To combine both job stages into a single, coherent YAML script for a CI/CD pipeline (assuming GitLab CI as the context given the structure), you would essentially just need one instance of the job definition, since they are duplicates. There wouldn't be a need to repeat the same job unless there were different conditions or scripts that needed to be run separately. Below is the combined version, which is essentially one of your provided job stages as they are identical: