Skip to content

Commit e7b129a

Browse files
committed
Refactor job defaults
1 parent c36384b commit e7b129a

File tree

1 file changed

+25
-35
lines changed

1 file changed

+25
-35
lines changed

.circleci/config.yml

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
version: 2.1
22

3-
# Common variables, containers, jobs and steps.
4-
job_defaults: &job_defaults
5-
# TODO: We should move away from using a directory
6-
# TODO: that requires root permission to be created.
7-
# TODO: Changing this requires rebuilding all docker images.
8-
working_directory: /app
9-
shell: /bin/bash --login
10-
113
test_containers:
12-
- &job_parameters
4+
- &container_base
5+
image: <<parameters.image>>
6+
environment:
7+
BUNDLE_GEMFILE: /app/Gemfile
8+
JRUBY_OPTS: --dev # Faster JVM startup: https://github.com/jruby/jruby/wiki/Improving-startup-time#use-the---dev-flag
9+
# Override number of concurrent compiles in grpc gem, see https://github.com/grpc/grpc/pull/28250 and https://github.com/DataDog/dd-trace-rb/issues/1791
10+
# If you see gem installation failing with "Killed" on CircleCI and `gem install --platform ruby grpc` reproduces the
11+
# issue when you connect to the testing container via ssh, then try lowering this file a notch.
12+
GRPC_RUBY_BUILD_PROCS: 6
13+
DD_INSTRUMENTATION_TELEMETRY_ENABLED: false
14+
DD_REMOTE_CONFIGURATION_ENABLED: false
15+
TEST_OPENSEARCH_HOST: opensearch
16+
TEST_OPENSEARCH_PORT: 9200
17+
DD_AGENT_HOST: testagent
18+
DD_TRACE_AGENT_PORT: 9126
19+
DATADOG_GEM_CI: true
20+
TEST_DATADOG_INTEGRATION: 1
21+
COVERAGE_BASE_DIR: coverage
22+
- &test_job_default
23+
# TODO: We should move away from using a directory
24+
# TODO: that requires root permission to be created.
25+
# TODO: Changing this requires rebuilding all docker images.
26+
working_directory: /app
27+
shell: /bin/bash --login
28+
resource_class: <<parameters.resource_class_to_use>>
1329
parameters:
1430
ruby_version:
1531
description: Ruby version
@@ -25,32 +41,6 @@ test_containers:
2541
description: Use latest version of dependencies during testing
2642
type: boolean
2743
default: false
28-
resource_class: <<parameters.resource_class_to_use>>
29-
- &container_base_environment
30-
BUNDLE_GEMFILE: /app/Gemfile
31-
JRUBY_OPTS: --dev # Faster JVM startup: https://github.com/jruby/jruby/wiki/Improving-startup-time#use-the---dev-flag
32-
# Override number of concurrent compiles in grpc gem, see https://github.com/grpc/grpc/pull/28250 and https://github.com/DataDog/dd-trace-rb/issues/1791
33-
# If you see gem installation failing with "Killed" on CircleCI and `gem install --platform ruby grpc` reproduces the
34-
# issue when you connect to the testing container via ssh, then try lowering this file a notch.
35-
GRPC_RUBY_BUILD_PROCS: 6
36-
DD_INSTRUMENTATION_TELEMETRY_ENABLED: false
37-
DD_REMOTE_CONFIGURATION_ENABLED: false
38-
TEST_OPENSEARCH_HOST: opensearch
39-
TEST_OPENSEARCH_PORT: 9200
40-
DD_AGENT_HOST: testagent
41-
DD_TRACE_AGENT_PORT: 9126
42-
DATADOG_GEM_CI: true
43-
- &container_parameters_environment
44-
- *container_base_environment
45-
- TEST_DATADOG_INTEGRATION: 1
46-
- COVERAGE_BASE_DIR: coverage
47-
- &container_base
48-
image: <<parameters.image>>
49-
environment:
50-
*container_parameters_environment
51-
- &test_job_default
52-
<<: *job_defaults
53-
<<: *job_parameters
5444
docker:
5545
- *container_base
5646

0 commit comments

Comments
 (0)