diff --git a/config.yml b/config.yml new file mode 100644 index 000000000..8443d3d9f --- /dev/null +++ b/config.yml @@ -0,0 +1,69 @@ +version: 2.1 + +orbs: + maven: circleci/maven@2.0.0 # Maven orb for building and testing Java projects + +jobs: + build: + docker: + - image: cimg/openjdk:11.0 # Java build environment + steps: + - checkout + - run: + name: Build the Project + command: cd code/nexus-lab/circleci-101 && mvn clean package spring-boot:repackage + + lint: + docker: + - image: cimg/openjdk:11.0 + steps: + - checkout + - run: + name: Lint the Code + command: cd code/nexus-lab/circleci-101 && mvn checkstyle:check + + unit_test: + docker: + - image: cimg/openjdk:11.0 + steps: + - checkout + - run: + name: Run Unit Tests + command: cd code/nexus-lab/circleci-101 && mvn test + + + deploy_mock: + docker: + - image: cimg/openjdk:11.0 + steps: + - run: + name: Mock Deployment + command: echo "Deployment complete." + +workflows: + version: 2 + build_and_deploy: + jobs: + - build + - lint: + requires: + - build + - unit_test: # using docker executor for running unit tests + requires: + - build + - maven/test: # using maven orb for running unit tests + executor: + name: maven/default + tag: '17.0' + maven_command: mvn + command: test + settings_file: settings.xml + verify_dependencies: false + app_src_directory: ./code/nexus-lab/circleci-101 + test_results_path: ./target/surefire-reports + requires: + - build + - deploy_mock: + requires: + - lint + - unit_test