Skip to content

Commit 1830579

Browse files
committed
WIP
1 parent 7213931 commit 1830579

4 files changed

Lines changed: 38 additions & 12 deletions

File tree

.devcontainer/.env.example

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
# Official Ruby images
2-
IMAGE=ruby
2+
IMAGE="ruby:3.4.5-slim-bookworm"
33

4-
# Adjust as needed
5-
VERSION=3.4.5
6-
7-
# IMAGE=jruby
8-
# VERSION=latest
4+
# IMAGE="jruby:latest"
95

106
# E2E testing
117
SENTRY_DSN="http://user:pass@sentry.localhost/project/42"

.devcontainer/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
ARG IMAGE="ruby"
2-
ARG VERSION="3.4.5"
3-
ARG DISTRO="slim-bookworm"
42

5-
FROM ${IMAGE}:${VERSION}-${DISTRO} AS build
3+
FROM ${IMAGE} AS build
64

75
RUN apt-get update && apt-get install -y --no-install-recommends \
86
sudo \

.github/workflows/build_images.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,50 @@ permissions:
1919
jobs:
2020
build-and-push:
2121
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
ruby_image:
25+
- ruby:2.7.8-slim-bullseye
26+
- ruby:3.0.7-slim-bullseye
27+
- ruby:3.1.7-slim-bookworm
28+
- ruby:3.2.9-slim-bookworm
29+
- ruby:3.3.9-slim-bookworm
30+
- ruby:3.4.5-slim-bookworm
31+
2232
steps:
2333
- name: Check out current commit
2434
uses: actions/checkout@v4
2535

36+
- name: Generate short image name
37+
id: image_name
38+
run: |
39+
ruby_image="${{ matrix.ruby_image }}"
40+
41+
if [[ "$ruby_image" == ruby:* ]]; then
42+
version=$(echo "$ruby_image" | cut -d: -f2 | cut -d. -f1,2)
43+
short_name="sentry-ruby-devcontainer-${version}"
44+
elif [[ "$ruby_image" == jruby:latest ]]; then
45+
short_name="sentry-ruby-devcontainer-jruby-latest"
46+
elif [[ "$ruby_image" == jruby:* ]]; then
47+
version=$(echo "$ruby_image" | cut -d: -f2 | cut -d. -f1,2)
48+
short_name="sentry-ruby-devcontainer-jruby-${version}"
49+
else
50+
short_name="sentry-ruby-devcontainer-${ruby_image}"
51+
fi
52+
53+
echo "short_name=${short_name}" >> $GITHUB_OUTPUT
54+
echo "Generated short image name: ${short_name}"
55+
2656
- name: Build and push devcontainer image
2757
id: build
2858
uses: getsentry/action-build-and-push-images@main
2959
with:
30-
image_name: 'sentry-ruby-devcontainer-build'
60+
image_name: '${{ steps.image_name.outputs.short_name }}'
3161
dockerfile_path: '.devcontainer/Dockerfile'
3262
ghcr: true
3363
publish_on_pr: true
64+
build_args: |
65+
IMAGE=${{ matrix.ruby_image }}
3466
3567
- name: Use outputs
3668
run: |

.github/workflows/e2e_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
ruby_version: ["3.4.5"]
2727

2828
env:
29-
DOCKER_IMAGE: "ghcr.io/getsentry/sentry-ruby-devcontainer-build"
30-
DOCKER_TAG: "bff2bf4c90959b3710d26499a2eed0911953a325"
29+
DOCKER_IMAGE: "ghcr.io/getsentry/sentry-ruby-devcontainer-3.4"
30+
DOCKER_TAG: "9c29d73a943de506a5990f7407c93663c80b44fd"
3131

3232
steps:
3333
- name: Checkout code

0 commit comments

Comments
 (0)