From c8815a5dd864198e7932267ebbff40bd12c72247 Mon Sep 17 00:00:00 2001 From: Ng Heng Khai Date: Wed, 1 May 2024 03:29:30 +0800 Subject: [PATCH] Update config.yml Shifted common executors. Updated comments. --- .circleci/config.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c473bed..bf47c51 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,8 +5,8 @@ orbs: maven: circleci/maven@1.4.1 snyk: snyk/snyk@2.1.0 -jobs: - build_and_test: # Job name. +executors: # Executors define the environment in which the steps of a job will be run, allowing you to reuse a single executor definition across multiple jobs. + openjdk-with-postgres: docker: # Environment. - image: cimg/openjdk:21.0.2 environment: @@ -17,6 +17,10 @@ jobs: POSTGRES_PASSWORD: password # Must not be empty or undefined. It is trust authentication locally (inside the same container) so the password is not actually used. POSTGRES_DB: the_review_room # This optional environment variable defines the default database created when the image is first started (default is postgres). +jobs: + build_and_test: # Job name. + executor: openjdk-with-postgres + steps: - checkout # Check out source code to the working directory. - run: | @@ -29,7 +33,7 @@ jobs: path: target/the-review-room-0.0.1-SNAPSHOT.jar publish: # Also known as the build-and-push. - executor: docker/docker # Define the execution environment in which the steps of a job will run. + executor: docker/docker steps: - checkout @@ -44,7 +48,7 @@ jobs: scan: docker: - - image: cimg/base:current + - image: cimg/base:current # Define the execution environment in which the steps of a job will run. environment: # The environment allows us to create an environment for the job and allows us to create custom environment variables. IMAGE_NAME: nhkhai/the-review-room