Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Official support for Ruby 2.5 and 2.6 #802

Merged
merged 32 commits into from
Sep 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0aeb720
Official support for Ruby 2.5, 2.6, 2.7
marcotc Aug 30, 2019
0f7c99c
Fix Circleci yaml structure
marcotc Aug 30, 2019
f9ea76f
Add 2.6 and 2.7 to CI
marcotc Sep 3, 2019
34d319c
temporarily remove 2.7 from CI
marcotc Sep 3, 2019
58beb48
remove 2.7 changes from appraisal
marcotc Sep 3, 2019
7ea6498
remove 2.7
marcotc Sep 3, 2019
cf81edf
Update docs with new ruby support versions
marcotc Sep 3, 2019
1cc1428
Update docker image reference link in Dockerfile
marcotc Sep 3, 2019
7093a38
revert 2.4 docker compose
marcotc Sep 3, 2019
33b0123
accept personal images for CI
marcotc Sep 4, 2019
1b2ad2d
separate blocks for each ruby version
marcotc Sep 4, 2019
058f88c
update support matrix
marcotc Sep 4, 2019
e62183b
comment regarding not testing older rails
marcotc Sep 4, 2019
afdf421
Merge branch '0.27-dev' into feature/ruby-2_5-2_6-2_7
marcotc Sep 4, 2019
176782f
Official support for Ruby 2.5, 2.6, 2.7
marcotc Aug 30, 2019
d014b96
Fix Circleci yaml structure
marcotc Aug 30, 2019
026ca3a
Add 2.6 and 2.7 to CI
marcotc Sep 3, 2019
0c590b1
temporarily remove 2.7 from CI
marcotc Sep 3, 2019
bd38a65
remove 2.7 changes from appraisal
marcotc Sep 3, 2019
3488426
remove 2.7
marcotc Sep 3, 2019
182f7d8
Update docs with new ruby support versions
marcotc Sep 3, 2019
f13b38d
Update docker image reference link in Dockerfile
marcotc Sep 3, 2019
55d59f6
revert 2.4 docker compose
marcotc Sep 3, 2019
4e16b60
accept personal images for CI
marcotc Sep 4, 2019
9489f45
separate blocks for each ruby version
marcotc Sep 4, 2019
94436ab
update support matrix
marcotc Sep 4, 2019
e4b0213
comment regarding not testing older rails
marcotc Sep 4, 2019
3a7ccd9
Merge branch 'feature/ruby-2_5-2_6-2_7' of github.com:DataDog/dd-trac…
marcotc Sep 4, 2019
a7337e1
fix appraisal conflict
marcotc Sep 4, 2019
fd956cc
add support for rails5-postgres-redis-activesupport tests
marcotc Sep 4, 2019
f82b567
rubocop linting
marcotc Sep 4, 2019
06ed079
add ethon and typhoeus back after merge
marcotc Sep 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 153 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ ruby_containers: &ruby_containers
image: palazzem/docker-library:ddtrace_rb_2_4_6
environment:
- BUNDLE_GEMFILE=/app/Gemfile
- &container-2_5
image: marcotc/docker-library:ddtrace_rb_2_5_6
environment:
- BUNDLE_GEMFILE=/app/Gemfile
- &container-2_6
image: marcotc/docker-library:ddtrace_rb_2_6_4
environment:
- BUNDLE_GEMFILE=/app/Gemfile

test_containers: &test_containers
- &container_postgres
Expand Down Expand Up @@ -399,10 +407,125 @@ jobs:
keys:
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-2.4-{{ checksum ".circleci/bundle_checksum" }}'
- *step_run_all_tests

checkout-2.5:
<<: *job_defaults
docker:
- *container-2_5
steps:
- checkout
- save_cache:
key: '{{ .Environment.CIRCLE_CACHE_VERSION }}-repo-2.5-{{ .Environment.CIRCLE_SHA1 }}'
paths:
- /app
build-2.5:
<<: *job_defaults
docker:
- *container-2_5
steps:
- restore_cache:
keys:
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-2.5-{{ .Environment.CIRCLE_SHA1 }}'
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-repo-2.5-{{ .Environment.CIRCLE_SHA1 }}'
- *step_init_bundle_checksum
- restore_cache:
keys:
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-2.5-{{ checksum ".circleci/bundle_checksum" }}'
- *step_bundle_install
- *step_rubocop
- *step_appraisal_install
- *step_compute_bundle_checksum
- save_cache:
key: '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-2.5-{{ .Environment.CIRCLE_SHA1 }}'
paths:
- /app
- save_cache:
key: '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-2.5-{{ checksum ".circleci/bundle_checksum" }}'
paths:
- /usr/local/bundle
test-2.5:
<<: *job_defaults
docker:
- <<: *container-2_5
environment:
- TEST_DATADOG_INTEGRATION: 1
- *container_postgres
- *container_mysql
- *container_elasticsearch
- *container_redis
- *container_mongo
- *container_memcached
- *container_agent
steps:
- restore_cache:
keys:
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-2.5-{{ .Environment.CIRCLE_SHA1 }}'
- restore_cache:
keys:
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-2.5-{{ checksum ".circleci/bundle_checksum" }}'
- *step_run_all_tests

checkout-2.6:
<<: *job_defaults
docker:
- *container-2_6
steps:
- checkout
- save_cache:
key: '{{ .Environment.CIRCLE_CACHE_VERSION }}-repo-2.6-{{ .Environment.CIRCLE_SHA1 }}'
paths:
- /app
build-2.6:
<<: *job_defaults
docker:
- *container-2_6
steps:
- restore_cache:
keys:
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-2.6-{{ .Environment.CIRCLE_SHA1 }}'
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-repo-2.6-{{ .Environment.CIRCLE_SHA1 }}'
- *step_init_bundle_checksum
- restore_cache:
keys:
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-2.6-{{ checksum ".circleci/bundle_checksum" }}'
- *step_bundle_install
- *step_rubocop
- *step_appraisal_install
- *step_compute_bundle_checksum
- save_cache:
key: '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-2.6-{{ .Environment.CIRCLE_SHA1 }}'
paths:
- /app
- save_cache:
key: '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-2.6-{{ checksum ".circleci/bundle_checksum" }}'
paths:
- /usr/local/bundle
test-2.6:
<<: *job_defaults
docker:
- <<: *container-2_6
environment:
- TEST_DATADOG_INTEGRATION: 1
- *container_postgres
- *container_mysql
- *container_elasticsearch
- *container_redis
- *container_mongo
- *container_memcached
- *container_agent
steps:
- restore_cache:
keys:
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-2.6-{{ .Environment.CIRCLE_SHA1 }}'
- restore_cache:
keys:
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-2.6-{{ checksum ".circleci/bundle_checksum" }}'
- *step_run_all_tests

"deploy release":
<<: *job_defaults
docker:
- *container-2_4
- *container-2_5
steps:
- checkout
- run:
Expand All @@ -420,7 +543,7 @@ jobs:
"deploy prerelease Gem":
<<: *job_defaults
docker:
- *container-2_4
- *container-2_5
steps:
- checkout
- run:
Expand All @@ -431,10 +554,10 @@ jobs:
- run:
name: Rename to pre-release version based on branch name and build number
command: |
# create safe version string
PRE=$(echo "${CIRCLE_BRANCH:-unknown}.${CIRCLE_BUILD_NUM:-R$RANDOM}" | sed -e 's/[^a-zA-Z0-9+]\{1,\}/./g')
echo PRE=$PRE
sed lib/ddtrace/version.rb -i -e "s/^\([\t ]*PRE\) *=*/\1 = \'${PRE}\' #/g"
# create safe version string
PRE=$(echo "${CIRCLE_BRANCH:-unknown}.${CIRCLE_BUILD_NUM:-R$RANDOM}" | sed -e 's/[^a-zA-Z0-9+]\{1,\}/./g')
echo PRE=$PRE
sed lib/ddtrace/version.rb -i -e "s/^\([\t ]*PRE\) *=*/\1 = \'${PRE}\' #/g"
- run:
name: Upload prereleas Gem and rebuild index
command: S3_DIR=prerelease bundle exec rake release:gem
Expand Down Expand Up @@ -500,6 +623,26 @@ workflows:
<<: *filters_all_branches_and_tags
requires:
- build-2.4
- checkout-2.5:
<<: *filters_all_branches_and_tags
- build-2.5:
<<: *filters_all_branches_and_tags
requires:
- checkout-2.5
- test-2.5:
<<: *filters_all_branches_and_tags
requires:
- build-2.5
- checkout-2.6:
<<: *filters_all_branches_and_tags
- build-2.6:
<<: *filters_all_branches_and_tags
requires:
- checkout-2.6
- test-2.6:
<<: *filters_all_branches_and_tags
requires:
- build-2.6
- "deploy prerelease Gem":
<<: *filters_all_branches_and_tags
requires:
Expand All @@ -508,6 +651,8 @@ workflows:
- test-2.2
- test-2.3
- test-2.4
- test-2.5
- test-2.6
- "deploy release":
<<: *filters_only_release_tags
requires:
Expand All @@ -516,3 +661,5 @@ workflows:
- test-2.2
- test-2.3
- test-2.4
- test-2.5
- test-2.6
73 changes: 73 additions & 0 deletions .circleci/images/primary/Dockerfile-2.5.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Current version: https://github.com/docker-library/ruby/blob/6a7df7a72b4a3d1b3e06ead303841b3fdaca560e/2.5/buster/Dockerfile
FROM ruby:2.5.6

# 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 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"

# Install RubyGems
RUN gem update --system
RUN gem install bundler
ENV BUNDLE_SILENCE_ROOT_WARNING 1

RUN mkdir /app
WORKDIR /app

CMD ["/bin/sh"]
73 changes: 73 additions & 0 deletions .circleci/images/primary/Dockerfile-2.6.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Current version: https://github.com/docker-library/ruby/blob/6a7df7a72b4a3d1b3e06ead303841b3fdaca560e/2.6/buster/Dockerfile
FROM ruby:2.6.4

# 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 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"

# Install RubyGems
RUN gem update --system
RUN gem install bundler
ENV BUNDLE_SILENCE_ROOT_WARNING 1

RUN mkdir /app
WORKDIR /app

CMD ["/bin/sh"]
Loading