From 90896e02a97e4846707f923d85f0e6d20e113792 Mon Sep 17 00:00:00 2001 From: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> Date: Sun, 27 Apr 2025 05:39:27 +0700 Subject: [PATCH 1/4] Add .circleci/config.yml --- .circleci/config.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000000..62291703e26a7 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,31 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/configuration-reference +version: 2.1 + +# Define a job to be invoked later in a workflow. +# See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs +jobs: + say-hello: + # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. + # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job + docker: + # Specify the version you desire here + # See: https://circleci.com/developer/images/image/cimg/base + - image: cimg/base:current + + # Add steps to the job + # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps + steps: + # Checkout the code as the first step. + - checkout + - run: + name: "Say hello" + command: "echo Hello, World!" + +# Orchestrate jobs using workflows +# See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows +workflows: + say-hello-workflow: # This is the name of the workflow, feel free to change it to better match your workflow. + # Inside the workflow, you define the jobs you want to run. + jobs: + - say-hello \ No newline at end of file From 9b9f087ed2f71981b133d29e06fe3f8e95397ff0 Mon Sep 17 00:00:00 2001 From: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> Date: Sun, 27 Apr 2025 09:23:52 +0700 Subject: [PATCH 2/4] Updated config.yml --- .circleci/config.yml | 120 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 99 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 62291703e26a7..5121ad4351f4b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,31 +1,109 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. -# See: https://circleci.com/docs/configuration-reference version: 2.1 - -# Define a job to be invoked later in a workflow. -# See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs jobs: - say-hello: - # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. - # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job + build: docker: - # Specify the version you desire here - # See: https://circleci.com/developer/images/image/cimg/base - - image: cimg/base:current + - image: ubuntu:23.04 + + - image: mongo:6.0.14 + command: [mongod, --smallfiles] + + - image: postgres:14.12 + # some containers require setting environment variables + environment: + POSTGRES_USER: user + + - image: redis@sha256:54057dd7e125ca41afe526a877e8bd35ec2cdd33b9217e022ed37bdcf7d09673 + + - image: rabbitmq:3.12.12 + + environment: + TEST_REPORTS: /tmp/test-reports + + working_directory: ~/my-project - # Add steps to the job - # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps steps: - # Checkout the code as the first step. - checkout + + - run: + command: echo 127.0.0.1 devhost | sudo tee -a /etc/hosts + + # Create Postgres users and database + # Note the YAML heredoc '|' for nicer formatting + - run: | + sudo -u root createuser -h localhost --superuser ubuntu && + sudo createdb -h localhost test_db + + - restore_cache: + keys: + - v1-my-project-{{ checksum "project.clj" }} + - v1-my-project- + + - run: + environment: + SSH_TARGET: "localhost" + TEST_ENV: "linux" + command: | + set -xu + mkdir -p ${TEST_REPORTS} + run-tests.sh + cp out/tests/*.xml ${TEST_REPORTS} + + - run: | + set -xu + mkdir -p /tmp/artifacts + create_jars.sh << pipeline.number >> + cp *.jar /tmp/artifacts + + - save_cache: + key: v1-my-project-{{ checksum "project.clj" }} + paths: + - ~/.m2 + + # Save artifacts + - store_artifacts: + path: /tmp/artifacts + destination: build + + # Upload test results + - store_test_results: + path: /tmp/test-reports + + deploy-stage: + docker: + - image: ubuntu:23.04 + working_directory: /tmp/my-project + steps: + - run: + name: Deploy if tests pass and branch is Staging + command: ansible-playbook site.yml -i staging + + deploy-prod: + docker: + - image: ubuntu:23.04 + working_directory: /tmp/my-project + steps: - run: - name: "Say hello" - command: "echo Hello, World!" + name: Deploy if tests pass and branch is Main + command: ansible-playbook site.yml -i production -# Orchestrate jobs using workflows -# See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows workflows: - say-hello-workflow: # This is the name of the workflow, feel free to change it to better match your workflow. - # Inside the workflow, you define the jobs you want to run. + build-deploy: jobs: - - say-hello \ No newline at end of file + - build: + filters: + branches: + ignore: + - develop + - /feature-.*/ + - deploy-stage: + requires: + - build + filters: + branches: + only: staging + - deploy-prod: + requires: + - build + filters: + branches: + only: main \ No newline at end of file From ad4415ad276513863df50b5e4e8bace30bfc05f0 Mon Sep 17 00:00:00 2001 From: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> Date: Sun, 27 Apr 2025 09:28:14 +0700 Subject: [PATCH 3/4] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5121ad4351f4b..29513b62d13e3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: - image: ubuntu:23.04 - image: mongo:6.0.14 - command: [mongod, --smallfiles] + command: [mongod --dbpath /path/to/data] - image: postgres:14.12 # some containers require setting environment variables From 37b29ad897addfcbd4f01c01bec55283a27bd947 Mon Sep 17 00:00:00 2001 From: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> Date: Sun, 27 Apr 2025 09:31:08 +0700 Subject: [PATCH 4/4] Updated config.yml --- .circleci/config.yml | 120 ++++++++----------------------------------- 1 file changed, 21 insertions(+), 99 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 29513b62d13e3..62291703e26a7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,109 +1,31 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/configuration-reference version: 2.1 + +# Define a job to be invoked later in a workflow. +# See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs jobs: - build: + say-hello: + # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. + # See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job docker: - - image: ubuntu:23.04 - - - image: mongo:6.0.14 - command: [mongod --dbpath /path/to/data] - - - image: postgres:14.12 - # some containers require setting environment variables - environment: - POSTGRES_USER: user - - - image: redis@sha256:54057dd7e125ca41afe526a877e8bd35ec2cdd33b9217e022ed37bdcf7d09673 - - - image: rabbitmq:3.12.12 - - environment: - TEST_REPORTS: /tmp/test-reports - - working_directory: ~/my-project + # Specify the version you desire here + # See: https://circleci.com/developer/images/image/cimg/base + - image: cimg/base:current + # Add steps to the job + # See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps steps: + # Checkout the code as the first step. - checkout - - - run: - command: echo 127.0.0.1 devhost | sudo tee -a /etc/hosts - - # Create Postgres users and database - # Note the YAML heredoc '|' for nicer formatting - - run: | - sudo -u root createuser -h localhost --superuser ubuntu && - sudo createdb -h localhost test_db - - - restore_cache: - keys: - - v1-my-project-{{ checksum "project.clj" }} - - v1-my-project- - - - run: - environment: - SSH_TARGET: "localhost" - TEST_ENV: "linux" - command: | - set -xu - mkdir -p ${TEST_REPORTS} - run-tests.sh - cp out/tests/*.xml ${TEST_REPORTS} - - - run: | - set -xu - mkdir -p /tmp/artifacts - create_jars.sh << pipeline.number >> - cp *.jar /tmp/artifacts - - - save_cache: - key: v1-my-project-{{ checksum "project.clj" }} - paths: - - ~/.m2 - - # Save artifacts - - store_artifacts: - path: /tmp/artifacts - destination: build - - # Upload test results - - store_test_results: - path: /tmp/test-reports - - deploy-stage: - docker: - - image: ubuntu:23.04 - working_directory: /tmp/my-project - steps: - - run: - name: Deploy if tests pass and branch is Staging - command: ansible-playbook site.yml -i staging - - deploy-prod: - docker: - - image: ubuntu:23.04 - working_directory: /tmp/my-project - steps: - run: - name: Deploy if tests pass and branch is Main - command: ansible-playbook site.yml -i production + name: "Say hello" + command: "echo Hello, World!" +# Orchestrate jobs using workflows +# See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows workflows: - build-deploy: + say-hello-workflow: # This is the name of the workflow, feel free to change it to better match your workflow. + # Inside the workflow, you define the jobs you want to run. jobs: - - build: - filters: - branches: - ignore: - - develop - - /feature-.*/ - - deploy-stage: - requires: - - build - filters: - branches: - only: staging - - deploy-prod: - requires: - - build - filters: - branches: - only: main \ No newline at end of file + - say-hello \ No newline at end of file