Skip to content

Commit a990413

Browse files
authored
[#1571] Split CircleCI config into multiple files. (#2105)
1 parent 444c17f commit a990413

53 files changed

Lines changed: 1026 additions & 498 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

.circleci/config.yml

Lines changed: 3 additions & 184 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CircleCI 2.0 configuration file.
1+
# CircleCI configuration file for building, testing, and deploying.
22
#
33
# This configuration file uses the "docker" executor to run the Docker stack.
44
#
@@ -103,15 +103,6 @@ aliases:
103103
# Load variables from .env file, respecting existing values, and make them available for the next steps.
104104
command: t=$(mktemp) && export -p >"${t}" && set -a && . ./.env && set +a && . "${t}" && export -p >> "$BASH_ENV"
105105

106-
################################################################################
107-
# PARAMETERS
108-
################################################################################
109-
110-
parameters:
111-
run_update_dependencies:
112-
type: boolean
113-
default: false
114-
115106
################################################################################
116107
# JOBS
117108
################################################################################
@@ -199,6 +190,7 @@ jobs:
199190
- /root/project/.data
200191

201192
# Nightly database job. Same as above, but with additional variables set.
193+
# Triggered by the "nightly-db" schedule configured in CircleCI UI.
202194
database-nightly:
203195
<<: *job-database
204196
environment:
@@ -527,53 +519,6 @@ jobs:
527519
path: *artifacts
528520
#;> DEPLOYMENT
529521

530-
#;< DEPS_UPDATE_PROVIDER_CI
531-
# Self-hosted dependency updates.
532-
# Add the following environment variables to the CircleCI project:
533-
# - RENOVATE_TOKEN: GitHub access token.
534-
# - RENOVATE_REPOSITORIES: Repository to run Renovate on as `vendor/repository`.
535-
# - RENOVATE_GIT_AUTHOR: Author for Renovate commits as `Name <email@example.com>`.
536-
# Variables provided below can be overridden in the CircleCI project settings.
537-
update-dependencies:
538-
docker:
539-
- image: renovate/renovate:40.36.8
540-
environment:
541-
RENOVATE_PLATFORM: 'github'
542-
RENOVATE_AUTODISCOVER: false
543-
RENOVATE_DEPENDENCY_DASHBOARD_TITLE: 'Renovate Dependency Dashboard (self-hosted) by CircleCI'
544-
RENOVATE_DEPENDENCY_DASHBOARD: false
545-
RENOVATE_DRY_RUN: false
546-
LOG_LEVEL: 'debug'
547-
548-
steps:
549-
- checkout
550-
- run:
551-
name: Check if RENOVATE_TOKEN is set
552-
command: |
553-
if [ -z "${RENOVATE_TOKEN}" ]; then
554-
echo "RENOVATE_TOKEN is not set. Skipping job."
555-
circleci-agent step halt
556-
fi
557-
558-
if [ -z "${RENOVATE_REPOSITORIES}" ]; then
559-
echo "Renovate repository is not set. Skipping job."
560-
circleci-agent step halt
561-
fi
562-
563-
if [ -z "${RENOVATE_GIT_AUTHOR}" ]; then
564-
echo "Renovate git author is not set. Skipping job."
565-
circleci-agent step halt
566-
fi
567-
568-
- run:
569-
name: Validate Renovate configuration
570-
command: renovate-config-validator
571-
572-
- run:
573-
name: Run Renovate
574-
command: renovate
575-
#;> DEPS_UPDATE_PROVIDER_CI
576-
577522
#;============================================================================
578523
#; Vortex development section. Removed during Vortex installation/update.
579524
#;============================================================================
@@ -616,96 +561,6 @@ jobs:
616561

617562
- store_artifacts:
618563
path: *artifacts
619-
620-
#-----------------------------------------------------------------------------
621-
# Launching and testing databases stored within Docker data image.
622-
#-----------------------------------------------------------------------------
623-
#
624-
# Switching between "database in file" (DIF, mounted data volume) and
625-
# "database-in-image" (DIDI, data volume is a part of the image) is
626-
# done by providing the value of VORTEX_DB_IMAGE environment variable,
627-
# which would be set in .env file for consumer projects.
628-
#
629-
# Also, the source of the database can be either file (downloaded from
630-
# remote location) or a previous version of the data image.
631-
#
632-
# This means that there should be the following tests for Vortex
633-
# database-in-image workflow functionality:
634-
# 1. DB is file -> create data image -> cache data image and push it to registry -> build and test site
635-
# 2. DB is image -> create data image -> cache data image and push it to registry -> build and test site
636-
#
637-
# Since we need to have "database" job generic for consumer sites and any
638-
# logic is controlled within Vortex scripts, we have to create additional
639-
# test jobs below and run them as a part of the CI system for Vortex itself.
640-
#
641-
# Job to test creation of the image from DB dump file when using
642-
# VORTEX_DB_IMAGE workflow.
643-
vortex-dev-didi-database-fi:
644-
<<: *job-database
645-
environment:
646-
VORTEX_DOWNLOAD_DB_SOURCE: url
647-
VORTEX_DOWNLOAD_DB_FORCE: 1
648-
# Use container image database storage despite that the file is coming
649-
# from CURL - this is to make sure that image is exported into cache
650-
# to be used between jobs. Note that in consumer project .env file would
651-
# have VORTEX_DB_IMAGE variable set and this environment variable
652-
# would not be required.
653-
#
654-
# Note that here and below we are using "destination" demo image - this
655-
# is to allow updating of this image from CI tests without jeopardizing
656-
# main demo image.
657-
VORTEX_DB_IMAGE: drevops/vortex-dev-mariadb-drupal-data-demo-destination-11.x
658-
# Use a separate tag to make sure that pushed image does not affect
659-
# other tests (pushing broken image as 'latest' would fail other tests).
660-
VORTEX_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG: vortex-dev-didi-database-fi
661-
# Also, use this job to test pushing of the DB image to the container
662-
# registry to replicate what database-nightly job would do.
663-
VORTEX_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED: 1
664-
# Use custom cache key for this workflow to make sure that caches from
665-
# the main workflow are separated from this one.
666-
VORTEX_CI_DB_CACHE_BRANCH: vortex-dev-didi-fi
667-
668-
# Job to test creation of the image from the previous version of the image
669-
# when using database-in-image workflow.
670-
vortex-dev-database-ii:
671-
<<: *job-database
672-
environment:
673-
VORTEX_DOWNLOAD_DB_SOURCE: VORTEX_CONTAINER_REGISTRY
674-
VORTEX_DOWNLOAD_DB_FORCE: 1
675-
VORTEX_DB_IMAGE: drevops/vortex-dev-mariadb-drupal-data-demo-destination-11.x
676-
VORTEX_DEPLOY_CONTAINER_REGISTRY_IMAGE_TAG: vortex-dev-database-ii
677-
# Also, use this job to test pushing of the DB image to the container
678-
# registry so replicate what database-nightly job would do.
679-
VORTEX_EXPORT_DB_CONTAINER_REGISTRY_DEPLOY_PROCEED: 1
680-
# Use custom cache key for this workflow to make sure that caches from
681-
# the main workflow are separated from this one.
682-
VORTEX_CI_DB_CACHE_BRANCH: vortex-dev-didi-ii
683-
684-
# Job to test build of the image from the previous stage of the image when
685-
# using database-in-image workflow. Overwriting just the VORTEX_DB_IMAGE
686-
# variable should change the storage mechanisms, but preserve application-level
687-
# stack operation.
688-
vortex-dev-didi-build-fi:
689-
<<: *job_build
690-
environment:
691-
VORTEX_DB_IMAGE: drevops/vortex-dev-mariadb-drupal-data-demo-destination-11.x:vortex-dev-didi-database-fi
692-
# Use custom cache key for this workflow to make sure that caches from
693-
# the main workflow are separated from this one.
694-
VORTEX_CI_DB_CACHE_BRANCH: vortex-dev-didi-fi
695-
# Migration database is always file-based and is not supported as an
696-
# image. Skip migration in DIDI test jobs.
697-
MIGRATION_SKIP: 1
698-
699-
vortex-dev-didi-build-ii:
700-
<<: *job_build
701-
environment:
702-
VORTEX_DB_IMAGE: drevops/vortex-dev-mariadb-drupal-data-demo-destination-11.x:vortex-dev-database-ii
703-
# Use custom cache key for this workflow to make sure that caches from
704-
# the main workflow are separated from this one.
705-
VORTEX_CI_DB_CACHE_BRANCH: vortex-dev-didi-ii
706-
# Migration database is always file-based and is not supported as an
707-
# image. Skip migration in DIDI test jobs.
708-
MIGRATION_SKIP: 1
709564
#=============================================================================
710565
#;> VORTEX_DEV
711566

@@ -714,7 +569,6 @@ jobs:
714569
################################################################################
715570

716571
workflows:
717-
version: 2
718572
# Commit workflow. Runs for every commit push to the remote repository.
719573
commit:
720574
jobs:
@@ -769,7 +623,7 @@ workflows:
769623
#;============================================================================
770624
#;
771625
#;< VORTEX_DEV
772-
# Run functional tests for Vortex.
626+
# Run functional tests for Vortex to assert CircleCI configuration is correct.
773627
# Note that these jobs must run within the "commit" workflow, because they
774628
# depend on the "build" job.
775629
# Run tests after 'build' job.
@@ -779,22 +633,6 @@ workflows:
779633
filters:
780634
tags:
781635
only: /.*/
782-
783-
# Test workflow to test VORTEX_DB_IMAGE workflow for DB from file.
784-
vortex-dev-didi-fi:
785-
jobs:
786-
- vortex-dev-didi-database-fi
787-
- vortex-dev-didi-build-fi:
788-
requires:
789-
- vortex-dev-didi-database-fi
790-
791-
# Test workflow to test VORTEX_DB_IMAGE workflow for DB from the container registry.
792-
vortex-dev-didi-ii:
793-
jobs:
794-
- vortex-dev-database-ii
795-
- vortex-dev-didi-build-ii:
796-
requires:
797-
- vortex-dev-database-ii
798636
#=============================================================================
799637
#;> VORTEX_DEV
800638

@@ -811,22 +649,3 @@ workflows:
811649
jobs:
812650
- database-nightly
813651
#;> !PROVISION_TYPE_PROFILE
814-
815-
#;< DEPS_UPDATE_PROVIDER_CI
816-
# Self-hosted Renovate workflow.
817-
update-dependencies:
818-
triggers:
819-
- schedule:
820-
cron: "5 11,23 * * *"
821-
filters:
822-
branches:
823-
only:
824-
- develop
825-
jobs:
826-
- update-dependencies
827-
828-
update-dependencies-manual:
829-
when: << pipeline.parameters.run_update_dependencies >>
830-
jobs:
831-
- update-dependencies
832-
#;> DEPS_UPDATE_PROVIDER_CI

.circleci/update-dependencies.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# CircleCI configuration file for automated dependency updates via Renovate.
2+
#
3+
# Scheduled pipelines:
4+
# The `update-dependencies` workflow requires a schedule trigger configured in
5+
# CircleCI UI.
6+
# Go to Project Settings > Triggers > Add Scheduled Trigger:
7+
# - Trigger name: update-dependencies
8+
# - Config source: update-dependencies.yml
9+
# - Branch: develop
10+
# - Schedule: Every day at 11:05 and 23:05 UTC (or a custom schedule)
11+
# See https://www.vortextemplate.com/docs/continuous-integration/circleci
12+
version: '2.1'
13+
14+
################################################################################
15+
# PARAMETERS
16+
################################################################################
17+
18+
parameters:
19+
run_update_dependencies:
20+
type: boolean
21+
default: false
22+
23+
################################################################################
24+
# JOBS
25+
################################################################################
26+
27+
jobs:
28+
# Self-hosted dependency updates.
29+
# Add the following environment variables to the CircleCI project:
30+
# - RENOVATE_TOKEN: GitHub access token.
31+
# - RENOVATE_REPOSITORIES: Repository to run Renovate on as `vendor/repository`.
32+
# - RENOVATE_GIT_AUTHOR: Author for Renovate commits as `Name <email@example.com>`.
33+
# Variables provided below can be overridden in the CircleCI project settings.
34+
update-dependencies:
35+
docker:
36+
- image: renovate/renovate:40.36.8
37+
environment:
38+
RENOVATE_PLATFORM: 'github'
39+
RENOVATE_AUTODISCOVER: false
40+
RENOVATE_DEPENDENCY_DASHBOARD_TITLE: 'Renovate Dependency Dashboard (self-hosted) by CircleCI'
41+
RENOVATE_DEPENDENCY_DASHBOARD: false
42+
RENOVATE_DRY_RUN: false
43+
LOG_LEVEL: 'debug'
44+
45+
steps:
46+
- checkout
47+
- run:
48+
name: Check if RENOVATE_TOKEN is set
49+
command: |
50+
if [ -z "${RENOVATE_TOKEN}" ]; then
51+
echo "RENOVATE_TOKEN is not set. Skipping job."
52+
circleci-agent step halt
53+
fi
54+
55+
if [ -z "${RENOVATE_REPOSITORIES}" ]; then
56+
echo "Renovate repository is not set. Skipping job."
57+
circleci-agent step halt
58+
fi
59+
60+
if [ -z "${RENOVATE_GIT_AUTHOR}" ]; then
61+
echo "Renovate git author is not set. Skipping job."
62+
circleci-agent step halt
63+
fi
64+
65+
- run:
66+
name: Validate Renovate configuration
67+
command: renovate-config-validator
68+
69+
- run:
70+
name: Run Renovate
71+
command: renovate
72+
73+
################################################################################
74+
# WORKFLOWS
75+
################################################################################
76+
77+
workflows:
78+
# Self-hosted Renovate workflow.
79+
# Requires an "update-dependencies" schedule trigger configured in CircleCI UI.
80+
update-dependencies:
81+
when:
82+
and:
83+
- equal: [scheduled_pipeline, << pipeline.trigger_source >>]
84+
- equal: ["update-dependencies", << pipeline.schedule.name >>]
85+
jobs:
86+
- update-dependencies
87+
88+
update-dependencies-manual:
89+
when: << pipeline.parameters.run_update_dependencies >>
90+
jobs:
91+
- update-dependencies

0 commit comments

Comments
 (0)