Skip to content

Commit

Permalink
Merge branch 'master' into branch-coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
marcotc committed Mar 24, 2021
2 parents 0fa2c88 + b23f22f commit 6859b15
Show file tree
Hide file tree
Showing 620 changed files with 10,402 additions and 3,079 deletions.
140 changes: 129 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ test_containers:
description: Jit enabled?
type: boolean
default: false
resource_class_to_use:
description: Resource class to use
type: string
default: medium
- &container_base_environment
BUNDLE_GEMFILE: /app/Gemfile
JRUBY_OPTS: --dev # Faster JVM startup: https://github.com/jruby/jruby/wiki/Improving-startup-time#use-the---dev-flag
- &container_parameters_environment
- *container_base_environment
- RUBY_OPT: <<# parameters.jit >>--jit<</ parameters.jit >>
Expand Down Expand Up @@ -132,6 +137,7 @@ orbs:
jobs:
build:
<<: *test_job_default
resource_class: <<parameters.resource_class_to_use>>
steps:
- checkout
- restore_cache:
Expand Down Expand Up @@ -161,6 +167,34 @@ orbs:
key: bundle-{{ .Environment.CIRCLE_CACHE_VERSION }}-<<parameters.ruby_version>>-{{ checksum "lib/ddtrace/version.rb" }}-{{ .Branch }}-{{ checksum "Gemfile" }}-{{ checksum "Appraisals" }}-{{ checksum "ddtrace.gemspec" }}-{{ checksum ".circleci/bundle_checksum" }}'
paths:
- /usr/local/bundle
build_and_test_integration:
executor: docker-integration
parameters:
ruby_version:
description: Ruby version
type: string
integration_apps:
description: Integration apps
type: string
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Build integration base images
command: ./integration/script/build-images -v <<parameters.ruby_version>>
- run:
name: Build integration app images
command: |
for i in <<parameters.integration_apps>>; do
./integration/apps/$i/script/build-images -v <<parameters.ruby_version>>
done
- run:
name: Test integration apps
command: |
for i in <<parameters.integration_apps>>; do
./integration/apps/$i/script/ci -v <<parameters.ruby_version>>
done
test:
<<: *test_job_default
docker:
Expand Down Expand Up @@ -299,6 +333,9 @@ orbs:
name: Wait for container on port <<parameters.port>>
command: dockerize -wait 'tcp://localhost:<<parameters.port>>' -timeout '<<parameters.timeout>>'
executors:
docker-integration:
docker:
- image: circleci/buildpack-deps:stretch

jobs:
"deploy release":
Expand Down Expand Up @@ -402,10 +439,20 @@ job_configuration:
image: marcotc/docker-library:ddtrace_rb_3.0.0
jit: true
# JRuby
- &config-jruby-9_2
- &config-jruby-9_2_0_0 # Oldest supported version
<<: *filters_all_branches_and_tags
ruby_version: 'jruby-9.2.0.0'
image: marcotc/docker-library:ddtrace_rb_jruby_9_2_0_0
- &config-jruby-9_2-latest # More recent release of 9.2
<<: *filters_all_branches_and_tags
ruby_version: 'jruby-9.2'
image: marcotc/docker-library:ddtrace_rb_jruby_9_2
ruby_version: 'jruby-9.2-latest'
image: marcotc/docker-library:ddtrace_rb_jruby_9_2_11_1
# TruffleRuby
- &config-truffleruby-21_0_0
<<: *filters_all_branches_and_tags
ruby_version: 'truffleruby-21.0.0'
image: ivoanjo/docker-library:ddtrace_rb_truffleruby_21_0_0
resource_class_to_use: large

workflows:
version: 2
Expand All @@ -429,7 +476,9 @@ workflows:
- test-2.6
- test-2.7
- test-3.0
- test-jruby-9.2
- test-jruby-9.2.0.0
- test-jruby-9.2-latest
# soon™️ - test-truffleruby-21.0.0
- orb/changelog:
<<: *config-2_7
name: changelog
Expand All @@ -438,6 +487,53 @@ workflows:
filters:
branches:
only: /bump_to_version_.*/
# Integration
- orb/build_and_test_integration:
name: build_and_test_integration-2.0
integration_apps: 'ruby rack'
ruby_version: '2.0'
<<: *filters_all_branches_and_tags
- orb/build_and_test_integration:
name: build_and_test_integration-2.1
integration_apps: 'ruby rack'
ruby_version: '2.1'
<<: *filters_all_branches_and_tags
- orb/build_and_test_integration:
name: build_and_test_integration-2.2
integration_apps: 'ruby rack'
ruby_version: '2.2'
<<: *filters_all_branches_and_tags
- orb/build_and_test_integration:
name: build_and_test_integration-2.3
integration_apps: 'ruby rack rails-five'
ruby_version: '2.3'
<<: *filters_all_branches_and_tags
- orb/build_and_test_integration:
name: build_and_test_integration-2.4
integration_apps: 'ruby rack rails-five'
ruby_version: '2.4'
<<: *filters_all_branches_and_tags
- orb/build_and_test_integration:
name: build_and_test_integration-2.5
integration_apps: 'ruby rack rails-five'
ruby_version: '2.5'
<<: *filters_all_branches_and_tags
- orb/build_and_test_integration:
name: build_and_test_integration-2.6
integration_apps: 'ruby rack rails-five'
ruby_version: '2.6'
<<: *filters_all_branches_and_tags
- orb/build_and_test_integration:
name: build_and_test_integration-2.7
integration_apps: 'ruby rack rails-five'
ruby_version: '2.7'
<<: *filters_all_branches_and_tags
- orb/build_and_test_integration:
name: build_and_test_integration-3.0
# TODO: Get Rack & Rails apps working with Ruby 3.0
integration_apps: 'ruby'
ruby_version: '3.0'
<<: *filters_all_branches_and_tags
# MRI
- orb/build:
<<: *config-2_0
Expand Down Expand Up @@ -526,13 +622,31 @@ workflows:
- build-3.0-jit
# JRuby
- orb/build:
<<: *config-jruby-9_2
name: build-jruby-9.2
<<: *config-jruby-9_2_0_0
name: build-jruby-9.2.0.0
- orb/test:
<<: *config-jruby-9_2_0_0
name: test-jruby-9.2.0.0
requires:
- build-jruby-9.2.0.0
- orb/build:
<<: *config-jruby-9_2-latest
name: build-jruby-9.2-latest
- orb/test:
<<: *config-jruby-9_2
name: test-jruby-9.2
<<: *config-jruby-9_2-latest
name: test-jruby-9.2-latest
requires:
- build-jruby-9.2
- build-jruby-9.2-latest
# TruffleRuby
# soon™️
# - orb/build:
# <<: *config-truffleruby-21_0_0
# name: build-truffleruby-21.0.0
# - orb/test:
# <<: *config-truffleruby-21_0_0
# name: test-truffleruby-21.0.0
# requires:
# - build-truffleruby-21.0.0
# Release jobs
- "deploy prerelease Gem":
<<: *filters_all_branches_and_tags
Expand All @@ -548,7 +662,9 @@ workflows:
- test-2.7
- test-3.0
- test-3.0-jit
- test-jruby-9.2
- test-jruby-9.2.0.0
- test-jruby-9.2-latest
# soon™️ - test-truffleruby-21.0.0
- "deploy release":
<<: *filters_only_release_tags
requires:
Expand All @@ -563,4 +679,6 @@ workflows:
- test-2.7
- test-3.0
- test-3.0-jit
- test-jruby-9.2
- test-jruby-9.2.0.0
- test-jruby-9.2-latest
# soon™️ - test-truffleruby-21.0.0
73 changes: 73 additions & 0 deletions .circleci/images/primary/Dockerfile-jruby-9.2.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Current version: https://github.com/cpuguy83/docker-jruby/blob/db08637839406420a254a9c825d94994cded5021/9000/jre/Dockerfile
FROM jruby:9.2.0.0

# Make apt non-interactive
RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \
&& echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci

ENV DEBIAN_FRONTEND=noninteractive

# Install required packages
RUN set -ex; \
apt-get update; \
mkdir -p /usr/share/man/man1; \
apt-get install -y --no-install-recommends \
git mercurial xvfb \
locales sudo openssh-client ca-certificates tar gzip parallel \
net-tools netcat unzip zip bzip2 gnupg curl wget \
tzdata rsync vim \
build-essential; \
rm -rf /var/lib/apt/lists/*;

# Set timezone to UTC by default
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime

# Set language
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en

# Install jq
RUN JQ_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/jq-latest" \
&& curl --silent --show-error --location --fail --retry 3 --output /usr/bin/jq $JQ_URL \
&& chmod +x /usr/bin/jq \
&& jq --version

# Install Docker
RUN set -ex \
&& export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/x86_64/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \
&& DOCKER_URL="https://download.docker.com/linux/static/stable/x86_64/${DOCKER_VERSION}" \
&& echo Docker URL: $DOCKER_URL \
&& curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \
&& ls -lha /tmp/docker.tgz \
&& tar -xz -C /tmp -f /tmp/docker.tgz \
&& mv /tmp/docker/* /usr/bin \
&& rm -rf /tmp/docker /tmp/docker.tgz \
&& which docker \
&& (docker version || true)

# Install Docker Compose
RUN COMPOSE_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/docker-compose-latest" \
&& curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \
&& chmod +x /usr/bin/docker-compose \
&& docker-compose version

# Install Dockerize
RUN DOCKERIZE_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/dockerize-latest.tar.gz" \
&& curl --silent --show-error --location --fail --retry 3 --output /tmp/dockerize-linux-amd64.tar.gz $DOCKERIZE_URL \
&& tar -C /usr/local/bin -xzvf /tmp/dockerize-linux-amd64.tar.gz \
&& rm -rf /tmp/dockerize-linux-amd64.tar.gz \
&& dockerize --version

# Install RubyGems
RUN gem update --system
RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME"
ENV BUNDLE_SILENCE_ROOT_WARNING 1

# Ensure JRuby is available when running "bash --login"
RUN echo "export PATH=/opt/jruby/bin:$BUNDLE_BIN:\$PATH" >> ~/.profile

RUN mkdir /app
WORKDIR /app

CMD ["bin", "bash", "--login"]
73 changes: 73 additions & 0 deletions .circleci/images/primary/Dockerfile-truffleruby-21.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
FROM flavorjones/truffleruby:21.0.0-buster

# Make apt non-interactive
RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \
&& echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci

ENV DEBIAN_FRONTEND=noninteractive

# Install required packages
RUN set -ex; \
apt-get update; \
mkdir -p /usr/share/man/man1; \
apt-get install -y --no-install-recommends \
git mercurial xvfb \
locales sudo openssh-client ca-certificates tar gzip parallel \
net-tools netcat unzip zip bzip2 gnupg curl wget \
tzdata rsync vim; \
rm -rf /var/lib/apt/lists/*;

# Set timezone to UTC by default
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime

# Set language
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en

# Install jq
RUN JQ_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/jq-latest" \
&& curl --silent --show-error --location --fail --retry 3 --output /usr/bin/jq $JQ_URL \
&& chmod +x /usr/bin/jq \
&& jq --version

# Install Docker
RUN set -ex \
&& export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/x86_64/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \
&& DOCKER_URL="https://download.docker.com/linux/static/stable/x86_64/${DOCKER_VERSION}" \
&& echo Docker URL: $DOCKER_URL \
&& curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \
&& ls -lha /tmp/docker.tgz \
&& tar -xz -C /tmp -f /tmp/docker.tgz \
&& mv /tmp/docker/* /usr/bin \
&& rm -rf /tmp/docker /tmp/docker.tgz \
&& which docker \
&& (docker version || true)

# Install Docker Compose
RUN COMPOSE_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/docker-compose-latest" \
&& curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \
&& chmod +x /usr/bin/docker-compose \
&& docker-compose version

# Install Dockerize
RUN DOCKERIZE_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/dockerize-latest.tar.gz" \
&& curl --silent --show-error --location --fail --retry 3 --output /tmp/dockerize-linux-amd64.tar.gz $DOCKERIZE_URL \
&& tar -C /usr/local/bin -xzvf /tmp/dockerize-linux-amd64.tar.gz \
&& rm -rf /tmp/dockerize-linux-amd64.tar.gz \
&& dockerize --version

# Install RubyGems
RUN gem update --system
RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME"

# Upgrade RubyGems and Bundler
RUN gem update --system
RUN gem install bundler
ENV BUNDLE_SILENCE_ROOT_WARNING 1

RUN mkdir /app
WORKDIR /app

CMD ["/bin/sh"]
4 changes: 2 additions & 2 deletions .github/workflows/create-next-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
steps:
- name: Get next minor version
id: semvers
uses: WyriHaximus/github-action-next-semvers@0.1.0
uses: WyriHaximus/github-action-next-semvers@b135abb108d66990a85e18623d906404f4350ce4
with:
version: ${{ github.event.milestone.title }}
- name: Create next milestone
uses: WyriHaximus/github-action-create-milestone@0.1.0
uses: WyriHaximus/github-action-create-milestone@ab85332e3150ec018daf497a0f761fe69d52bc7d
with:
title: ${{ steps.semvers.outputs.minor }}
env:
Expand Down
Loading

0 comments on commit 6859b15

Please sign in to comment.